Skip to content Skip to sidebar Skip to footer

Playback Error On Using Clearkey Drm Schema In Exoplayer 2 Android

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\':

Solution 1:

Looking at the length of the key string, the most likely problem is that the key has not been base64URL encoded in the call to LocalMediaDrmCallback.

An AES 128-bit key will be:

  • 32 characters as a hex key
  • 24 characters when base64 encoded

Assuming that a4631a153a443df9eed0593043db7519 is the key in hex format then you need to convert it (and the keyID also) to base64 and then pass them this way to LocalMediaDrmCallback.

Using one of the common online convertors you can see this would give:

  • hex key: a4631a153a443df9eed0593043db7519
  • base64 encoded pGMaFTpEPfnu0FkwQ9t1GQ==

You can see an example of doing this programmatically also in this GitHub issue answer: https://github.com/google/ExoPlayer/issues/3856#issuecomment-366197586

Solution 2:

It is working fine after removing \n from the keyString.. :)

Post a Comment for "Playback Error On Using Clearkey Drm Schema In Exoplayer 2 Android"