I am trying to play the .MPD file, which is using
DRMSchema : clearKey
For playing it i am creating a DefaultDrmSessionManager in the following way
String keyString = "{\"keys\":[{\"kty\":\"oct\",\"k\":\"y1QQhMmXMa70__dFAMEurQ\n" +
" \",\"kid\":\"bXbyXLF_Xha46u9rv1gtjg\n" +
" \"},{\"kty\":\"oct\",\"k\":\"pGMaFTpEPfnu0FkwQ9t1GQ\n" +
" \",\"kid\":\"88XgNh5mVLKPgEnHeLI5Rg\n" +
" \"}],'type':\"temporary\"}";
LogMgr.i("DRMCallback JSON : " + keyString);
drmCallback = new LocalMediaDrmCallback(keyString.getBytes());
mediaDrm = FrameworkMediaDrm.newInstance(uuid);
DefaultDrmSessionManager<FrameworkMediaCrypto> drmSessionManager = new DefaultDrmSessionManager<>(uuid, mediaDrm, drmCallback, null, multiSession);
After that, when i am trying to use this DefaultDrmSessionManager for playing the video, i am getting ExoPlayerImplInternal: Playback error, i am attaching the Log for reference.
E/ExoPlayerImplInternal: **Playback error**.
com.google.android.exoplayer2.ExoPlaybackException
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:780)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:583)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:518)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:301)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:164)
at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: android.media.MediaCodec$CryptoException: **Crypto key not available**
at android.media.MediaCodec.native_queueSecureInputBuffer(Native Method)
at android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:2547)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:771)
Please guide me, what i am doing wrong
It is working fine after removing \n from the keyString.. :)