I am trying to implement Android app for playing widevine-protected video. I build my application on Exoplayer and I have issue with MediaDrm.
android.media.MediaDrm$MediaDrmStateException: Failed to get key request: DRM vendor-defined error: -2998
at android.media.MediaDrm.getKeyRequest(Native Method)
at com.google.android.exoplayer.drm.StreamingDrmSessionManager.postKeyRequest(StreamingDrmSessionManager.java:370)
at com.google.android.exoplayer.drm.StreamingDrmSessionManager.openInternal(StreamingDrmSessionManager.java:314)
at com.google.android.exoplayer.drm.StreamingDrmSessionManager.open(StreamingDrmSessionManager.java:284)
at com.google.android.exoplayer.MediaCodecTrackRenderer.maybeInitCodec(MediaCodecTrackRenderer.java:325)
at com.google.android.exoplayer.MediaCodecTrackRenderer.onInputFormatChanged(MediaCodecTrackRenderer.java:739)
at com.google.android.exoplayer.MediaCodecTrackRenderer.readFormat(MediaCodecTrackRenderer.java:511)
at com.google.android.exoplayer.MediaCodecTrackRenderer.doSomeWork(MediaCodecTrackRenderer.java:492)
at com.google.android.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:417)
at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:205)
I have this exception. I found that this exception is thrown at this line of code:
keyRequest = mediaDrm.getKeyRequest(sessionId, schemeData, mimeType, MediaDrm.KEY_TYPE_STREAMING, params);
All parameters of method are set correctly, but calling of this method fails and thrown exception above.
Do you know how can I solve it? Thanks for any help.
I finally solved it. The problem was with device, which I was using for testing. This device is Samsung Galaxy S4 with Android 5.0.1. When I tried my code on different device (Nexus 5, some Samsung tablet, etc.), it worked fine. So probably there is some bug or missing support of Widevine Modular in Galaxy S4.
Related
I am having issues with PubNub when subscribing. This is bit random. Works well 90% time on emulator. But fails most of the time on an actual device:
var pubnub = new PubNub(pnConfiguration);
addListener()
pubnub.subscribe()
.channels(Arrays.asList(pubnubChannelId))
.execute();
Error :
PNStatus(category=PNAccessDeniedCategory,
errorData=PNErrorData(information=null,
throwable=com.pubnub.api.PubNubException),
error=true, statusCode=403,
operation=PNSubscribeOperation, tlsEnabled=true .....
I have enabled verbose logs in PubNub Configuration. I am at total loss trying to understand this error messages.
Where do I start debugging this ? same code works most of the time on emulator but on a physical device ?
appreciate any pointers.
Thanks
replacing the character + with another one is a workaround. Pubnub will post an official build soon.
I'm starting to migrate my GoogleCast integration from v2 to v3.5 on iOS when I run your code lab sample I always receive the current errors:
CastVideos-ios[436:35929] -[GCKDeviceAuthChannel didReceiveBinaryMessage:] Device is revoked by CRL.
CastVideos-ios[436:35929] -[GCKCastDeviceConnector deviceAuthChannel:didFailToAuthenticateWithError:] Not an authentic device, disconnecting.
Obviously the videos are not casting to my Chromecast 2.
I'm using the kGCKMediaDefaultReceiverApplicationID to initialize the GCKCastContext
We recommend that you take a look at the sample app on how to correctly integrate the Cast SDK with your app: https://github.com/googlecast/CastVideos-ios
It is very important that you support the Cast lifecycle correctly.
So I have read and tried about everything in order to start a simple bluetooth listener in Unity but with no luck. And couldn't find anyone who managed this.
The main issue is this socket exception:
"SocketException: An address incompatible with the requested protocol was used."
Has anyone successfully implemented bluetooth communication in Unity?
P.S.
I also tried the 32feet library but it gives the same exception when trying to create a new bluetooth listener :
Guid mUUID = new Guid("00001101-0000-1000-8000-00805F9B34FB");
BluetoothListener blueListener = new BluetoothListener(mUUID);
I am trying to stream Audio to a bluetooth device in-code in C#. I've picked up the 32feet.net library to help with this. I am able to get a bluetooth speaker paired just fine, and then I use the code below to connect to the device.
globalClient.BeginConnect(device.DeviceAddress, BluetoothService.SerialPort, new AsyncCallback(BluetoothConnectedAsyncHandler), device);
Async Callback method:
private void BluetoothConnectedAsyncHandler(IAsyncResult result)
{
BluetoothDeviceInfo connectedDevice = (BluetoothDeviceInfo)result.AsyncState;
globalClient.EndConnect(result);
if (result.IsCompleted)
{
NetworkStream btStream = globalClient.GetStream();
}
}
This all works well, but when I try to set the service from BluetoothService.SerialPort to BluetoothService.AudioSource, then I receive a SocketException on the "globalClient.EndConnect(result);" line saying "A socket operation failed because the destination host was down". See screenshot:
I've also tried to throw data at the speaker through the NetworkStream when it is setup with BluetoothService.SerialPort, but it doesn't play anything - no noise or static.
My running hypothesis is that this can't be done easily with 32feet.net, and I would have to code up the a2dp spec in code. I think the 32feet.net library is used so that I can tell the Operating System to use the speaker as an output device, rather than control audio output in-code as a supported feature.
Please help! Has anyone done this?
Would it even work if I sent an a2dp compliant stream to the device over the BluetoothService.SerialPort connection?
A2DP spec: https://www.bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=8236
Thanks for any help!
Update:
This isn't possible within the 32feet.net library, you can only set the device up to talk the the Microsoft audio service using the setService method call in 32feet.net
www.nudoq.org/#!/Packages/32feet.NET/InTheHand.Net.Personal/MicrosoftSdpService/M/SetService
This MS service manages the A2DP output to the device. There is no way to directly output audio from code into the Bluetooth Device using this library in C#.
I'm creating a local http server to provide http live streaming to a AVPlayer. It works fine on iOS 7, but failed in iOS 8 beta. Player never send request to my local server, its playerItem's status always become AVPlayerStatusFailed right after I call player's 'play' method.
The error I received is as following:
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x179c675c0 {NSUnderlyingError=0x17a252c60 "The operation couldn’t be completed. (OSStatus error -12666.)", NSLocalizedFailureReason=An unknown error occurred (-12666), NSLocalizedDescription=The operation could not be completed}
I have asked this issue on iOS Developer forum and got response from Apple - "it's due to a bug in the first 8.0 seed".
However, they didn't say that they'll fix this bug and instead asking me why I need to do this. Does anyone have the same problem?