我正在使用 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,但是在获取有关它的任何信息时,对于它的下一步感到很困惑。