Show Menu
TOPICS×

Digital Rights Management

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 Digital Rights Management

  1. Add the DRMMetadataInfoAvailableEvent to get the DRMMetadata .
    player.addEventListener(AdobePSDK.PSDKEventType.DRM_METADATA_INFO_AVAILABLE, onDRMMetadataInfoAvaialble);
    
    
  2. 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); 
    };
    
    
  3. Create the DRMManager in the setupVideo method.
    var drmManager = player.drmManager;
    
    
  4. 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":{ 
        } 
      } 
    };
    
    
  5. Add the protection data to the drmManager.
    drmManager.setProtectionData(protectionData);
    
    
  6. 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;
    
    
  7. Test your configuration.