How to: override hardware DRM

This topic describes how to override hardware DRM if the content to be played back does not support hardware DRM.

By default, hardware DRM is used if the system supports it. However, some content is not supported in hardware DRM. One example of this is Cocktail content. Another example is any content that uses a video codec other than H.264 and HEVC. Another example is HEVC content, as some hardware DRM will support HEVC and some will not. Therefore, if you want to play a piece of content and hardware DRM doesn’t support it on the system in question, you may want to opt out of hardware DRM.

The following example shows how to opt-out of hardware DRM. You only need to do this before you switch. Also, make sure you don’t have any PlayReady object in memory, otherwise behavior is undefined.

var applicationData = Windows.Storage.ApplicationData.current;
var localSettings = applicationData.localSettings.createContainer(“PlayReady”, Windows.Storage.ApplicationDataCreateDisposition.always);
localSettings.values[“SoftwareOverride”] = true;

To switch back to hardware DRM, set the SoftwareOverride value to false.

For every media playback, you need to set MediaProtectionManager to:

mediaProtectionManager.properties[“Windows.Media.Protection.UseSoftwareProtectionLayer”] = true;

The best way to tell if you are in hardware DRM or software DRM is look at C:\Users\<username>\AppData\Local\Packages\Microsoft.ZuneVideo_8wekyb3d8bbwe\LocalState\PlayReady\*

  • If there is an mspr.hds file, then you are in software DRM.
  • If you have another *.hds file, then you are in hardware DRM.
  • You can delete the entire PlayReady folder and retry your test as well.