首页 > 解决方案 > 无法使用带 DASH 流 URL 的 Widevine DRM 播放视频

问题描述

我们正在实施一个视频 Roku 频道,在其中,我们希望使用带 DASH 流 URL 的 Widevine DRM 来播放视频。我遵循了 Roku 开发论坛提供的文档,但它不起作用。

我目前的代码是:

videoContent = createObject("roSGNode", "ContentNode")
videoContent.StreamFormat = "dash"
videoContent.Url = 'provided dash streaming url
' for widevide DRM
drmParams = {
    keySystem: "Widevine",
    licenseServerURL: 'provided our licenseServerURL
}
videoContent.drmParams = drmParams

HttpAgent = CreateObject("roHttpAgent")
HttpAgent.AddHeader("Authorization",AuthorizationTokenString)
m.VideoPlayer.setHttpAgent(HttpAgent)

m.VideoPlayer.content = videoContent
m.VideoPlayer.control = "play"

我参考了以下链接以找出方法。 https://sdkdocs.roku.com/display/sdkdoc/Content+Protection#ContentProtection-Widevine-BETA https://sdkdocs.roku.com/display/sdkdoc/Content+Meta-Data#ContentMeta-Data-ExampleofconfiguringadashstreamwithWidevineDRM

如果我在这里遗漏了什么,请告诉我,并帮助我解决这个问题。

标签: rokubrightscriptscenegraph

解决方案


您是否已将此添加到您频道的清单中?

requires_widevine_drm=1
requires_widevine_version=1.0

此外,在创建视频节点时,根据https://developer.roku.com/en-gb/docs/references/brightscript/components/rourltransfer.md

为了让您的网络服务器执行上述步骤来验证您的 Roku 流媒体播放器,您的应用程序需要在执行任何 https 请求之前调用以下函数:

在您的代码中,它将是:

HttpAgent.SetCertificatesFile("common:/certs/ca-bundle.crt")
HttpAgent.InitClientCertificates()
HttpAgent.AddHeader("X-Roku-Reserved-Dev-Id", "")

推荐阅读