I want to play Widevine Modular - DASH video in my app and I want to use VideoView
or ExoPlayer
for it.
Is there any sample how I can setup it? Or can you provide me any sample code how to acquire the licence? I have URL of the video and also the Widevine server URL.
Before we were using Widevine classic and the request for licence looks like this:
private void prepareDrmInfoRequest()
{
mDrmInfoRequest = new DrmInfoRequest(DrmInfoRequest.TYPE_RIGHTS_ACQUISITION_INFO, "application/mp4");
mDrmInfoRequest.put("WVVideoUrlKey", "http://some_url.com/dash/1.mpd");
mDrmInfoRequest.put("WVDRMServerKey", "http://some_url.com/video/widevine_modular/?auth_token=haslůkfjlksjfljnvlakhnsufn");
mDrmInfoRequest.put("WVCAUserDataKey", "LJKHlklkhkljhKJLHuzgztfZTFZTUFzutf");
mDrmInfoRequest.put("WVPortalKey", "provider");
}
and then
public int processDrm()
{
DrmInfo df = mDrmManagerClient.acquireDrmInfo(mDrmInfoRequest);
if(df != null)
{
return mDrmManagerClient.processDrmInfo(df);
}
}
After that the video was playing on VideoView or ExoPlayer.