You can complete Digital Rights Management (DRM)-specific workflows.
You can listen to the AdobePSDK.DRMMetadataInfoEvent
event to handle DRM workflows:
...
player.addEventListener(AdobePSDK.PSDKEventType.DRM_METADATA_INFO_AVAILABLE, onDRMMetadataInfoAvailable);
...
Add the DRMMetadataInfoAvailableEvent
to get the DRMMetadata
.
player.addEventListener(AdobePSDK.PSDKEventType.DRM_METADATA_INFO_AVAILABLE, onDRMMetadataInfoAvaialble);
Implement the onDRMMetadataInfoAvailable
section above the line in step 1.
var onDRMMetadataInfoAvaialble = function(event) {
var drmMetadataInfo = event.drmMetadataInfo;
var drmMetadata = null;
if(drmMetadataInfo) {
drmMetadata = drmMetadataInfo.drmMetadata;
}
drmManager.acquireLicense(drmMetadata, null, null);
};
Create the DRMManager in the setupVideo method.
var drmManager = player.drmManager;
Create the protection data for Widevine and PlayReady by copying the following sample:
var protectionData = {
"com.widevine.alpha":{
"serverURL":"https://wv.service.expressplay.com/hms/wv/rights/?
ExpressPlayToken=[YOUR_EXPRESSPLAY_TOKEN]"
},
"com.microsoft.playready":{
"serverURL":"https://pr.test.expressplay.com/playready/RightsManager.asmx?
ExpressPlayToken=[YOUR_EXPRESSPLAY_TOKEN]",
"httpRequestHeaders":{
}
}
};
Add the protection data to the drmManager.
drmManager.setProtectionData(protectionData);
Change the resource URL to a DASH test stream.
Ensure that you update the resource type, because this is now DASH.
var resourceUrl = "https://ptdemos.com/videos/dashdrm/stream.mpd";
var resourceType = AdobePSDK.MediaResourceType.DASH;
Test your configuration.