MediaProtectionManager Klasse

Definition

Enthält ein Inhaltsschutz-Manager-Objekt für eine Anwendung, die geschützte Medieninhalte verarbeitet.

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
Vererbung
Object Platform::Object IInspectable MediaProtectionManager
Attribute

Windows-Anforderungen

Gerätefamilie
Windows 10 (eingeführt in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (eingeführt in v1.0)

Beispiele

Das folgende Beispiel zeigt, wie Sie einen MediaProtectionManager erstellen, die Eigenschaft Properties festlegen und Ereignislistener für ComponentLoadFailed und ServiceRequested hinzufügen.

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

Hinweise

Der MediaProtectionManager kann auf zwei Arten an die Medienwiedergabeinfrastruktur übergeben werden:

  • Als Attribut für ein <video> - oder <audio> -Tag mit der msSetMediaProtectionManager-Methode .
  • Direkt an eine Medienwiedergabe-API. Das MediaProtectionManager-Objekt wird über Content Enabler-Objekte benachrichtigt. Diese Objekte müssen von der Anwendung verarbeitet werden, um zugriff auf geschützte Inhalte zu gewähren. Jedes MediaProtectionManager-Objekt ist einem einzelnen instance der Wiedergabe zugeordnet.

Konstruktoren

MediaProtectionManager()

Initialisiert eine neue instance der MediaProtectionManager-Klasse.

Eigenschaften

Properties

Ruft ein PropertySet-Objekt ab, das alle Eigenschaften enthält, die an den Schutz-Manager angefügt sind.

Ereignisse

ComponentLoadFailed

Wird ausgelöst, wenn das Laden von Binärdaten fehlschlägt.

RebootNeeded

Wird ausgelöst, wenn ein Neustart erforderlich ist, nachdem die Komponente erneuert wurde.

ServiceRequested

Wird ausgelöst, wenn ein Dienst angefordert wird.

Gilt für: