我正在使用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,但在下一步得到任何关于它的信息,所以对它的下一步感到困惑。
发布于 2019-11-02 04:29:22
UWP MediaElement不实现对来自外部来源的PlayReady内容的必要支持。也就是说,FFmpegMSS没有UWP PlayReday播放功能。
你只能在微软自己的流媒体资源中使用PlayReady。
https://stackoverflow.com/questions/58665032
复制相似问题