我正在使用 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,但在下一步获取任何有关它的信息时感到很困惑。
最佳答案
UWP MediaElement
未对来自外部来源的 PlayReady 内容实现必要的支持。也就是说,没有带有 FFmpegMSS
的 UWP PlayReday 播放。 .
您只能使用 Microsoft 自己的流媒体源获得 PlayReady。
关于c# - 如何设置 FFMPEGInterop 以使用 DRM playready,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58665032/