0

我正在使用 FFMPEGInterop 类播放 UWP 视频。我需要使用 playready 设置来播放它,但我遇到了问题。

我可以只使用 mediaplayerelement 并创建保护管理器来播放 playready,但是当我创建一个 FFMPEGMSS 来流式传输它时,它会失败。将保护管理器添加到 MediaStreamSource 时表示值超出范围。

var StreamSource = FFmpegMSS.GetMediaStreamSource();
var protectionManager = new Windows.Media.Protection.MediaProtectionManager();
Windows.Foundation.Collections.PropertySet cpSystems = new Windows.Foundation.Collections.PropertySet();
cpSystems.Add("{F4637010-03C3-42CD-B932-B48ADF3A6A54}", "Microsoft.Media.PlayReadyClient.PlayReadyWinRTTrustedInput"); //Playready
protectionManager.Properties.Add("Windows.Media.Protection.MediaProtectionSystemIdMapping", cpSystems);
protectionManager.Properties.Add("Windows.Media.Protection.MediaProtectionSystemId", "{F4637010-03C3-42CD-B932-B48ADF3A6A54}");
protectionManager.ServiceRequested += ProtectionManager_ServiceRequested;
protectionManager.ComponentLoadFailed += ProtectionManager_ComponentLoadFailed;

protectionManager.Properties.Add("Windows.Media.Protection.MediaProtectionContainerGuid", "{9A04F079-9840-4286-AB92-E65BE0885F95}");

var supportsHardwareDrm = PlayReadyStatics.CheckSupportedHardware(PlayReadyHardwareDRMFeatures.HardwareDRM);
if (!supportsHardwareDrm)
{
    protectionManager.Properties["Windows.Media.Protection.UseSoftwareProtectionLayer"] = true;
}
Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;

Header.Text = supportsHardwareDrm ? "SUPPORTED" : "NOT SUPPRTED";

StreamSource.MediaProtectionManager = protectionManager;

mediaElement.Source = MediaSource.CreateFromMediaStreamSource(StreamSource);

我应该可以使用设置保护管理器开始播放准备就绪的 DRM,但是在获取有关它的任何信息时,对于它的下一步感到很困惑。

4

1 回答 1

1

UWPMediaElement没有对来自外部源的 PlayReady 内容实施必要的支持。也就是说,没有 UWP PlayReday 播放FFmpegMSS

您只能使用 Microsoft 自己的流媒体源获得 PlayReady。

于 2019-11-01T20:29:21.850 回答