我正在尝试在 Chrome 中启用 Azure 托管的视频,以便在“租用期”内离线观看,以便其在几天后过期。我从 OfflinePlayReadyAndWidevine 开始java 示例项目。我更新了this method为所有三个持续时间指定 30 秒。
policyOverrides.setRentalDurationSeconds(30);
policyOverrides.setPlaybackDurationSeconds(30);
policyOverrides.setLicenseDurationSeconds(30);
这似乎有效。查看里面的 Assets 信息Azure Media Services Explorer ,我在“内容保护”选项卡中看到这些 30 秒的持续时间显示:
"properties.options": [
{
"policyOptionId": "1d9620f2-bc02-4ddc-a64f-b25e5f02b6e5",
"name": null,
"configuration": {
"widevineTemplate": "{\"AllowedTrackTypes\":\"SD_HD\",\"ContentKeySpecs\":[{\"TrackType\":\"SD\",\"SecurityLevel\":1,\"RequiredOutputProtection\":{\"HDCP\":\"HDCP_NONE\"}}],\"PolicyOverrides\":{\"CanPlay\":true,\"CanPersist\":true,\"CanRenew\":false,\"RentalDurationSeconds\":30,\"PlaybackDurationSeconds\":30,\"LicenseDurationSeconds\":30}}"
},
"restriction": {}
}
],
但是好像没有生效。在 Windows 上的 Chrome 中,我将 URL 添加到 Shaka player及其Custom Content section ,单击下载按钮,拔掉互联网,我可以一遍又一遍地播放视频。看来还没有过期。我也没有在Azure media player中经历过期。 ,尽管我首先专注于让 Shaka 工作,因为它支持离线。
如果有人之前测试过它的工作原理,我将非常有兴趣看看如何!
最佳答案
在您的 Widevine 模板中,3 个属性名称:
- RentalDurationSeconds
- 播放持续时间
- 许可证持续时间
看起来与 Widevine 代理规范或 Widevine 模板上的 Azure 媒体服务文档中相应的 3 个属性名称不同 ( https://learn.microsoft.com/en-us/azure/media-services/previous/media-services-widevine-license-template-overview )
它们应该分别是
- rental_duration_seconds
- playback_duration_seconds
- license_duration_seconds
这样它将与上面的 Widevine 代理文档或 AMS 文档一致。
目前,您能否将 Widevine 模板设置为 JSON 字符串,而不是通过属性 setter ?
关于azure - Azure 中的 Widevine 加密视频不会过期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60328500/