Veeresh Charantimath
Veeresh Charantimath

Reputation: 4719

Load Dash Manifest with DRM content with ExoPlayer

I have a dash manifest which needs to be loaded in ExoPlayer, which is also DRM protected.

I can't seem to find any example as to how to achieve that other than using JWPlayer Android which did not work. executeProvisionRequest or executeKeyRequest was never called on loading my content.

Is there a simpler way to do this with ExoPlayer?

PlaylistItem content = new PlaylistItem.Builder()
            .file("MY_MANIFEST_FILE_PATH")
            .mediaDrmCallback(new WidevineMediaDrmCallback())
            .build();

    mPlayerView.load(content);




public class WidevineMediaDrmCallback implements MediaDrmCallback {
  @Override
  public byte[] executeProvisionRequest(UUID uuid, ExoMediaDrm.ProvisionRequest provisionRequest) throws Exception {
    String url = request.getDefaultUrl() + "&signedRequest=" + new String(request.getData());
    return Util.executePost(url, null, null); 
  }

  @Override
  public byte[] executeKeyRequest(UUID uuid, ExoMediaDrm.KeyRequest request) throws Exception {
    String url = request.getLicenseServerUrl();
    if (TextUtils.isEmpty(url)) {
        url = defaultUri;
    }
    return Util.executePost(url, request.getData(), null);
  }
}

Upvotes: 3

Views: 655

Answers (0)

Related Questions