DRM Configuration Setup Specific DRM configuration options are then nested inside of the drm block. It is possible to configure multiple forms of DRM within a particular source, which will be chosen according to the particular browser.


Custom http headers are sometimes required to be added to the license requests. These values are specific to the DRM provider that you are working with. The below example is using a header with name of customData set equal the value provided. These headers offer extra security and without them the license request will not be approved. Note that not all DRM providers require these custom header pairs. More information can be found on our developer site.


A typical workflow for DRM includes configuring multiple DRM technologies to cover the most common playback environments. These DRM technologies should be embedded inside of a particular source, to allow the player to fall back to the correct technology. An example of a fully nested DRM block is shown below. This method chooses the appropriate DRM technology based on the browser/client that is requesting the content.

<script>
  jwplayer('myElement').setup({
      playlist: [{
        sources: [{
          file: 'https://www.website.com/media/videofile.mpd',
          drm: {
            widevine: {
              url: 'https://widevine-proxy.appspot.com/proxy',
              headers: [{
                name: 'customData',
                value: 'abcdefg1234567hijklmn89101112opqrs98765tuvwxy'
              }]
            },
            playready: {
              url: 'https://playready-proxy.appspot.com/proxy',
              headers: [{
                name: 'customData',
                value: 'abcdefg1234567hijklmn89101112opqrs98765tuvwxy'
              }]
            }
          }
        },{
          file: 'https://www.website.com/media/videofile.m3u8',
          drm: {
            fairplay: {
              processSpcUrl: 'path to key server that provides ckc',
              certificateUrl: 'path to certificate'
            }
          }
        },{
          file: 'https://www.website.com/media/clearkey_manifest.mpd',
          drm: {
            clearkey: {
              key: 'xldkjfa9a38hfa98hsadf0a89h',
              keyId: '1234-5678-91011'
            }
          }
        }]
      }]
    });
    </script>

how to convert it to android?

2 Answers

0
Mick On

You need to decide if you are using a 'native' player in Android or using the browser.

The approach above is for browsers and you will most likely be using Widevine if the browser is on an Android device - the piece of information you usually always require is the License Authority or LA URL but this is likely to be the same as for your usual computer browser use cases. You may also require custom headers as shown in the above example - your DRM provider can help steer you here.

If you are using the native player, e.g. if you are using the JWPlayer SDK in an app, then JWPlayer uses ExoPlayer underneath and exposes its API's.

ExoPlayer is a Google provided Media Player for Android and is probably the most used one at this time.

JWPlayer provides some basic DRM info on the native player API here: https://developer.jwplayer.com/sdk/android/reference/

You probably want to take a look at the ExoPlayer documentation and the demo app to get a better feel for it also: https://google.github.io/ExoPlayer/drm.html

-1
Karim Mourra On

If using the Android SDK, you must follow the following instructions: https://developer.jwplayer.com/sdk/android/docs/developer-guide/drm/drm-protected-playback/

Basically you have to implement your own MediaDrmCallback implementation which is set to the playlist item. The MediaDrmCallback will contain the logic necessary to make requests to your license server