【发布时间】:2018-05-14 03:53:30
【问题描述】:
我正在使用 Videogular2 播放 azure 内容。托管在没有 DRM 的 azure 上的内容完美运行。当我实施具有令牌身份验证的 DRM 保护内容时,会出现 CORS 错误。从许可证服务器获取许可证时抛出错误。
以下是我的代码
stream = {
source: 'http://xxxxx.streaming.mediaservices.windows.net/xxxxxxx/abc512kb.ism/manifest(format=mpd-time-csf)',
licenseServers: {
'com.widevine.alpha': {
serverURL: 'https://xxxxxx.keydelivery.westindia.media.azure.net/Widevine/?KID=xxxxx-ef40-87ed-b348-xxxxxx'
}
},
token: 'Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
}
<video #media
[vgMedia]="media"
[vgDash]="stream.source"
[vgDRMLicenseServer]="stream.licenseServers"
[vgDRMToken]="stream.token"
id="singleVideo"
preload="auto" crossorigin
>
</video>
从许可证服务器获取许可证时出现以下错误。
对预检请求的响应未通过访问控制检查: 响应中“Access-Control-Allow-Origin”标头的值必须 当请求的凭据模式为时,不是通配符“*” '包括'。因此不允许使用原点“http://localhost:4300” 使用权。发起请求的凭证模式 XMLHttpRequest 由 withCredentials 属性控制。
如果我使用 chrome 的 disable-web-security 运行它,那么我调用的效果很好。
是否有人在播放 Azure Media 内容时遇到过此类问题。
【问题讨论】:
标签: azure cors azure-media-services videogular