首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何设置FFMPEGInterop以使用DRM playready

如何设置FFMPEGInterop以使用DRM playready
EN

Stack Overflow用户
提问于 2019-11-02 03:43:47
回答 1查看 322关注 0票数 0

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

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

代码语言:javascript
复制
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,但在下一步得到任何关于它的信息,所以对它的下一步感到困惑。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-11-02 04:29:22

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

你只能在微软自己的流媒体资源中使用PlayReady。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58665032

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档