MediaProtectionManager MediaProtectionManager MediaProtectionManager MediaProtectionManager MediaProtectionManager Class


Contains a content protection manager object for an application that handles protected media content.

public : sealed class MediaProtectionManager
struct winrt::Windows::Media::Protection::MediaProtectionManager
public sealed class MediaProtectionManager
Public NotInheritable Class MediaProtectionManager
var mediaProtectionManager = new mediaProtectionManager();

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)


The following example shows how to create a MediaProtectionManager, set the Properties property, and add event listeners for ComponentLoadFailed and ServiceRequested. See the How to use pluggable DRM topic for the full example.

mediaProtectionManager = 
    new Windows.Media.Protection.MediaProtectionManager();

function ServiceRequested(e) {
   logMsg("Got Enabler - system/type: {" + e.request.protectionSystem + "}/{" + e.request.type + "}");

function ComponentLoadFailed(e) {
   logMsg(e.information.items.size.toString() + " failed components");

   //  List the failing components
   for (var i = 0; i < e.information.items.size; i++) {
      logMsg("<h3>" + e.information.items[i].name + "</h3>" +
             "<p>Reasons=0x" + e.information.items[i].reasons.toString(16) +
             "<p>Renewal Id=" + e.information.items[i].renewalId);


function RebootNeeded(e) {
   logMsg("Reboot Required");

mediaProtectionManager.addEventListener("servicerequested", ServiceRequested, false);
mediaProtectionManager.addEventListener("componentloadfailed", ComponentLoadFailed, false);
mediaProtectionManager.addEventListener("rebootneeded", RebootNeeded, false);


The MediaProtectionManager can be passed to the media playback infrastructure in either of two ways:

  • As an attribute for a <video> or <audio> tag using the msSetMediaProtectionManager method.
  • Directly to a media playback API. The MediaProtectionManager object is notified of content enabler objects. These objects must be processed by the application, to establish access to protected content. Each MediaProtectionManager object is associated with a single instance of playback.


MediaProtectionManager() MediaProtectionManager() MediaProtectionManager() MediaProtectionManager() MediaProtectionManager()

Initializes a new instance of the MediaProtectionManager class.


Properties Properties Properties Properties Properties

Gets a PropertySet object containing any properties attached to the protection manager.


ComponentLoadFailed ComponentLoadFailed ComponentLoadFailed ComponentLoadFailed ComponentLoadFailed

Fires when the load of binary data fails.

RebootNeeded RebootNeeded RebootNeeded RebootNeeded RebootNeeded

Fires when a reboot is needed after the component is renewed.

ServiceRequested ServiceRequested ServiceRequested ServiceRequested ServiceRequested

Fires when a service is requested.