简体   繁体   English

使用Tizen AVPlay设置用于DRM​​许可证服务器身份验证的HTTP标头

[英]Setting HTTP Header for DRM license server authentication with Tizen AVPlay

I am using AVPlay to play DRM contents. 我正在使用AVPlay播放DRM内容。 I need to set a HTTP header for the license URL. 我需要为许可证URL设置HTTP标头。 How can I do it? 我该怎么做?

webapis.avplay.setDrm('PLAYREADY', 'SetProperties', angular.toJson({
    LicenseServer:entitlementData.LicenseURL,
    'X-AxDRM-Message':entitlementData.DRMToken
}));

I need to set X-AxDRM-Message in the HTTP header 我需要在HTTP标头中设置X-AxDRM-Message

As you may already know, angular.toJson() and JSON.stringify() have some significant difference. 您可能已经知道,angular.toJson()和JSON.stringify()有一些明显的区别。

Difference between toJSON() and JSON.Stringify() toJSON()和JSON.Stringify()之间的区别

By Checking out the Code example on this API reference, it seems JSON.stringify() should be Used. 通过检查此API参考上的Code示例,似乎应该使用JSON.stringify()。

http://developer.samsung.com/tv/develop/api-references/samsung-product-api-references/avplay-api http://developer.samsung.com/tv/develop/api-references/samsung-product-api-references/avplay-api

var drmParam = new Object();
drmParam.LicenseServer = "http://license.company.com";
drmParam.CustomData = "mycustom";
playerObj.setDrm("PLAYREADY", "SetProperties", JSON.stringify(drmParam));

You may try this format on your source code. 您可以在源代码上尝试这种格式。

In addition, This document contains some discussion on HTTP header, though its about Apple tvOS but may of your use I guess. 另外,本文档包含有关HTTP标头的一些讨论,尽管它与Apple tvOS有关,但我想可能有用。

Sending and Receiving AVPlayer HTTP Headers 发送和接收AVPlayer HTTP标头

What you need to do is set the parameters: 您需要做的是设置参数:

const drmParam = {
          DeleteLicenseAfterUse: true,
          LicenseServer: uri,
          X-AxDRM-Message: : entitlementData.DRMToken
        };

And then you need to make sure is a JSON Object like this: 然后,您需要确保是这样的JSON对象:

const params = JSON.stringify(drmParam);

After you have the object you will be able to do the parameter setup as follows: 在拥有对象之后,您将能够如下进行参数设置:

webapis.avplay.setDrm('PLAYREADY', 'SetProperties', params);

Hope that helps! 希望有帮助!

let DrmParam = {};

DrmParam.LicenseServer = entitlementData.LicenseURL;
DrmParam.HttpHeader = "X-AxDRM-Message:" + entitlementData.DRMToken;

webapis.avplay.setDrm("PLAYREADY", "SetProperties", JSON.stringify(DrmParam));

I figure out how to send multiple Http Headers to DRM License Server. 我弄清楚了如何将多个Http标头发送到DRM许可证服务器。 If you want to send multiple http headers, you must seperate them with \\n key. 如果要发送多个http标头,则必须使用\\ n键将它们分开。

You can try it yourself: 您可以自己尝试:

        var drmParam = {
            DeleteLicenseAfterUse: true,
            LicenseServer: licenseServerURL,
            HttpHeader: "Authorization:" + authValue + "\nMY-Ticket:" + ticketValue
        };
        webapis.avplay.setDrm("PLAYREADY", "SetProperties", JSON.stringify(drmParam));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 适用于Tizen的AVPlay,随着视频时长的增长而出现问题 - AVPlay for Tizen, ploblem with getting duration of video 用于身份验证标头的 Angular HTTP 拦截器 - Angular HTTP interceptor for Authentication header 基本的HTTP身份验证不包含标头中的JSON? (Backbone.js到Rails服务器) - Basic HTTP Authentication not including JSON in header? (Backbone.js to Rails server) 如何在Cast Receiver Player中续订过期的DRM许可证? - How to renew expired DRM license in Cast Receiver Player? 如何在 Dash.js 或类似文件中使用 ExoPlayer 的 DRM 许可证 - How to use DRM License for ExoPlayer in Dash.js or similar 在XMLHttpRequest中设置Authorization标头会更改HTTP谓词 - Setting Authorization header in XMLHttpRequest changes HTTP verb 如何在浏览器中存储服务器HTTP响应标头? - How to store server HTTP response header in browser? 如何从输入参数生成HTTP标头摘要身份验证值? - How to generate HTTP header digest authentication value from input params? 如何在.js 中设置 http header 'www-authenticate' 以进行代理身份验证 - How to set http header 'www-authenticate' for proxy authentication in .js 在angularjs中读取HTTP服务器头响应消息 - Reading HTTP server header response messages in angularjs
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM