Azure Media Services V2至V3升级 - 自定义密钥交付服务:如何提供清晰的钥匙值
我正在尝试将 Azure 媒体服务 v2 实现升级到使用自定义密钥传送服务的 v3 此处提到到 v3。除了本节和 REST API 部分的示例之外,我发现这在很大程度上没有记录,但我相信我已经弄清楚了大部分内容,但是在密钥的实际交付中,我想知道我返回的格式是否为正确的格式(我在任何地方都找不到这个)。尽管我看到请求通过并被发送回,但视频播放器似乎无法正常工作。
我是否以 ByteArray 格式返回密钥,如下面的 v3 示例所示?
媒体服务 v2 实施
private HttpResponseMessage GetKeyHttpResponse(IContentKey key)
{
var res = Request.CreateResponse(HttpStatusCode.OK);
res.Content = new ByteArrayContent(key.GetClearKeyValue());
return res;
}
媒体服务 v3 尝试
private HttpResponseMessage GetKeyHttpResponse(StreamingLocatorContentKey key)
{
var res = Request.CreateResponse(HttpStatusCode.OK);
res.Content = new ByteArrayContent(Encoding.ASCII.GetBytes(key.Value));
return res;
}
I am trying to upgrade an Azure Media Services v2 implementation to v3 which uses a Custom Key Delivery Service mentioned here to v3. Other than this section and samples from the REST API section, I have found this to be largely undocumented but I believe I have figured out mostly everything, however on the actual Delivery of the Key I am wondering if the format I am returning is in the correct format (I cannot find this easily anywhere). It seems that the Video Player is not working even though I see the request come through and getting sent back out.
Do I return the key in ByteArray format as seen in my v3 example below?
Media Services v2 Implementation
private HttpResponseMessage GetKeyHttpResponse(IContentKey key)
{
var res = Request.CreateResponse(HttpStatusCode.OK);
res.Content = new ByteArrayContent(key.GetClearKeyValue());
return res;
}
Media Services v3 Attempt
private HttpResponseMessage GetKeyHttpResponse(StreamingLocatorContentKey key)
{
var res = Request.CreateResponse(HttpStatusCode.OK);
res.Content = new ByteArrayContent(Encoding.ASCII.GetBytes(key.Value));
return res;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
非常感谢上面的@Sanjid,这里是工作解决方案(使用客户端视频播放器进行测试)。
Many thanks to @Sanjid above, here is the working solution (tested with a Client Side Video Player).