MediaProtectionManager Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Contains a content protection manager object for an application that handles protected media content.
public ref class MediaProtectionManager sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
class MediaProtectionManager final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class MediaProtectionManager final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
public sealed class MediaProtectionManager
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.MTA)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class MediaProtectionManager
function MediaProtectionManager()
Public NotInheritable Class MediaProtectionManager
- Inheritance
- Attributes
Windows requirements
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
Examples
The following example shows how to create a MediaProtectionManager, set the Properties property, and add event listeners for ComponentLoadFailed and ServiceRequested.
private void InitMediaProtectionManager()
{
mediaProtectionManager = new Windows.Media.Protection.MediaProtectionManager();
mediaProtectionManager.ServiceRequested += MediaProtectionManager_ServiceRequested;
mediaProtectionManager.ComponentLoadFailed += MediaProtectionManager_ComponentLoadFailed;
mediaProtectionManager.RebootNeeded += MediaProtectionManager_RebootNeeded;
}
private void MediaProtectionManager_RebootNeeded(MediaProtectionManager sender)
{
LogMessage("Reboot Required");
}
private void MediaProtectionManager_ComponentLoadFailed(MediaProtectionManager sender, ComponentLoadFailedEventArgs e)
{
LogMessage(e.Information.Items.Count.ToString() + " failed components");
LogMessage("<h2>Components:</h2>");
// List the failing components
for (var i = 0; i < e.Information.Items.Count; i++)
{
LogMessage("<h3>" + e.Information.Items[i].Name + "</h3>" +
"<p>Reasons=0x" + e.Information.Items[i].Reasons.ToString() +
"<p>Renewal Id=" + e.Information.Items[i].RenewalId);
}
e.Completion.Complete(true);
}
private void MediaProtectionManager_ServiceRequested(MediaProtectionManager sender, ServiceRequestedEventArgs e)
{
LogMessage("Got Enabler - system/type: {" + e.Request.ProtectionSystem + "}/{" + e.Request.Type + "}");
e.Completion.Complete(true);
}
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() |
Initializes a new instance of the MediaProtectionManager class. |
Properties
Properties |
Gets a PropertySet object containing any properties attached to the protection manager. |
Events
ComponentLoadFailed |
Fires when the load of binary data fails. |
RebootNeeded |
Fires when a reboot is needed after the component is renewed. |
ServiceRequested |
Fires when a service is requested. |