MediaProtectionManager MediaProtectionManager MediaProtectionManager MediaProtectionManager Class

Definition

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

public : sealed class MediaProtectionManager : IMediaProtectionManager
public sealed class MediaProtectionManager : IMediaProtectionManager
Public NotInheritable Class MediaProtectionManager Implements IMediaProtectionManager
var mediaProtectionManager = new mediaProtectionManager();
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

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 + "}");
   e.completion.complete(true);
}


function ComponentLoadFailed(e) {
   logMsg(e.information.items.size.toString() + " failed components");
   logMsg("<h2>Components:</h2>");

   //  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);
   }

   e.completion.complete(false);
}

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

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

Remarks

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.

Constructors

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

Initializes a new instance of the MediaProtectionManager class.

public : MediaProtectionManager()
public MediaProtectionManager()
Public Sub New()
var mediaProtectionManager = new mediaProtectionManager();

Properties

Properties Properties Properties Properties

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

public : IPropertySet Properties { get; }
public IPropertySet Properties { get; }
Public ReadOnly Property Properties As IPropertySet
var iPropertySet = mediaProtectionManager.properties;
Value
IPropertySet IPropertySet IPropertySet IPropertySet

The PropertySet object that contains the properties for this protection manager.

Examples

var cpsystems = new Windows.Foundation.Collections.PropertySet();

cpsystems["{1891D602-6F0A-40F7-90A1-3C24564F6D77}"] = "TestDRMInstall.Objects.AsfTrustedInput";

contentProtectionManager.properties["Windows.Media.Protection.MediaProtectionSystemIdMapping"] = cpsystems;

Remarks

The following properties are defined:

NameTypeDescription
Windows.Media.Protection.VideoFrameAccessCertificateUINT8 ArrayApplication certificate for accessing frames in frame server mode.
Windows.Media.Protection.MediaProtectionSystemIdGUIDProtection System ID
Windows.Media.Protection.MediaProtectionSystemContextUINT8 ArrayData associated with protection system for the current content.
Windows.Media.Protection.MediaProtectionSystemIdMappingIPropertySetReturns a mapping of the protection system id to the string for activating the trusted input object. The string for the protection system id must be in the format of a GUID (include {}) in upper case. This maps to a class name in the content protection system.
Windows.Media.Protection.MediaProtectionContainerGuidGUIDSpecifies the Digital Rights Management (DRM) scheme.

Events

ComponentLoadFailed ComponentLoadFailed ComponentLoadFailed ComponentLoadFailed

Fires when the load of binary data fails.

public : event ComponentLoadFailedEventHandler ComponentLoadFailed<>
public event ComponentLoadFailedEventHandler ComponentLoadFailed<>
Public Event ComponentLoadFailedEventHandler ComponentLoadFailed( Of )
function onComponentLoadFailed(eventArgs){/* Your code */}


mediaProtectionManager.addEventListener("componentLoadFailed", onComponentLoadFailed);
mediaProtectionManager.removeEventListener("componentLoadFailed", onComponentLoadFailed);

RebootNeeded RebootNeeded RebootNeeded RebootNeeded

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

public : event RebootNeededEventHandler RebootNeeded<>
public event RebootNeededEventHandler RebootNeeded<>
Public Event RebootNeededEventHandler RebootNeeded( Of )
function onRebootNeeded(eventArgs){/* Your code */}


mediaProtectionManager.addEventListener("rebootNeeded", onRebootNeeded);
mediaProtectionManager.removeEventListener("rebootNeeded", onRebootNeeded);

ServiceRequested ServiceRequested ServiceRequested ServiceRequested

Fires when a service is requested.

public : event ServiceRequestedEventHandler ServiceRequested<>
public event ServiceRequestedEventHandler ServiceRequested<>
Public Event ServiceRequestedEventHandler ServiceRequested( Of )
function onServiceRequested(eventArgs){/* Your code */}


mediaProtectionManager.addEventListener("serviceRequested", onServiceRequested);
mediaProtectionManager.removeEventListener("serviceRequested", onServiceRequested);