Configuring the HTTP Header to authenticate with a DRM license server using Tizen's AVPlay

I am trying to use AVPlay for playing DRM-protected content, but I'm facing an issue with setting a custom HTTP header for the license URL. Can anyone guide me on how to achieve this?

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

I specifically need to configure the X-AxDRM-Message parameter in the HTTP header.

Answer №1

I have successfully managed to send multiple Http Headers to a DRM License Server. To send multiple http headers, it is essential to separate them using the \n key.

If you wish to try it out yourself, here is a sample code snippet:

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

Answer №2

It's worth noting that there are significant differences between angular.toJson() and JSON.stringify().

Explore the variance between toJSON() and JSON.Stringify()

After examining the code example in this API reference, it appears that JSON.stringify() is the preferred method.

Access the AVPlay API reference here

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

Feel free to implement this format in your own source code.

Furthermore, this resource includes a discussion on HTTP headers specific to Apple tvOS, which could still be beneficial for your project.

Learn about Sending and Receiving AVPlayer HTTP Headers

Answer №3

To get started, your task is to define the following settings:

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

Ensure that the settings are structured in a JSON Object format like this:

const encryptedParams = JSON.stringify(securityParams);

Once you have the object ready, you can configure the parameters like this:

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

I hope this information proves helpful!

Answer №4

const drmSettings = {};

drmSettings.licenseServer = entitlementData.LicenseURL;
drmSettings.httpHeader = "X-AxDRM-Message:" + entitlementData.DRMToken;

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

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How can we stop the Bootstrap carousel from pausing when the mouse hovers over it and keep it cycling automatically?

Is there a way to stop the Bootstrap carousel from pausing when hovering with the mouse and instead have it continue cycling through items automatically? I've tried changing the pause argument from "hover" as mentioned in the documentation, but when ...

ng-animate causing an impact on the input element, even though it is not supposed to

As a newcomer to angularjs, I'm facing a challenge in animating only specific elements within my app. To achieve this, I have included the ngAnimate module in my app setup: var mrApp = angular.module("mrApp", ["ngRoute", "ngAnimate", "templates"]); ...

Discovering how to use the selenium-webdriver npm to navigate to a new window from a target="_blank" attribute

While trying to create a collection of selenium tests, I encountered an obstacle with the javascript selenium-webdriver npm package. One specific test involves selenium verifying that a target="_blank" link functions properly by checking the content of th ...

When incorporating @babel/standalone, a JavaScript memory limit is exceeded

I am currently working on a React app that I developed using create-react-app. My main goal is to take user input as code and then evaluate it in order to render the output. Here's what I have attempted so far: import React, { Component } from &apos ...

Scrolling to the complete height of a div using scrollTop

Experience an automated scroll to the bottom of the div, followed by a smooth upward motion over 5 seconds, all while looping seamlessly. A small issue arises where the code only recognizes the standard height set for the div, not its actual scrollable he ...

Can you explain the distinction between document.body.ononline and navigator.onLine?

Can you explain the distinction between document.body.ononline and navigator.onLine? Do they utilize the same JavaScript API for checking network connectivity status (online/offline)? I have searched on Google but couldn't find a definitive answer. If ...

Using axios to call a web API method from within a ReactJS web worker

Currently, I am utilizing Web Worker alongside ReactJS (Context API schema) and encountering a particular issue. The design of my Web API and Context is outlined below: WebWorker.js export default class WebWorker { constructor(worker) { let code = ...

Data is not found in req.body when making a fetch request

I have been attempting to send a fetch request to my server, but I am consistently receiving an empty req.body. Here is the client-side script: const form = document.getElementById('form1') form.addEventListener('submit', (e) => ...

Extracting JSON information from the callback function

Can the msg variable in JavaScript be returned from the callback function? I attempted to do so, but received a null value, even though msg contained data within the scope of the callback function. var msg = load(); function load() { $.ajax({ ...

How does a database contribute to the functionality of a redux application?

Recently, I started exploring redux and finally understood the architecture behind it. In a single page redux application where all data is stored in a central store and updated through frontend actions, what purpose does the back-end and database serve? ...

How come my countdown application functions properly when accessed through the browser via the HTML page, but encounters issues when utilized with an HTTP server?

I have encountered an issue where the app functions correctly when I open the HTML file in my browser, but fails to load the CSS and JavaScript when accessing it through localhost:3000. HTML: <html> <head> <link href="./main.css" rel="st ...

Props does not solely rely on Vue.js for data feeding

My journey with learning vue has just started, and I recently incorporated a prop into my vue component. At first glance, the code appeared to be correct, but then something unexpected occurred. import Vue from 'vue'; import App from './A ...

How can I add content to the body of a modal in Bootstrap 3?

My application has a button that, when clicked, is supposed to trigger a modal popup containing some data. I want the data in the modal to come from another application via a PHP file accessed through a URL. How can this be achieved? <?php echo '& ...

When attempting to delete a resource using an HTTP request in Insomnia, I encountered a TypeError stating that it was unable to read the property 'id'

I recently started using Express and am in the process of setting up the Delete function for my database within the MERN stack. While testing my CRUD operations using Insomnia, I have encountered an issue specifically with the Delete operation. The proble ...

What is the best way to display the tabcontent when clicking on a menu tab in this code, as neither method seems to work?

Take a look at my JSFiddle demo: <http://jsfiddle.net/xrtk9enc/2/> I suspect that the issue lies within the javascript section. My html code includes an Unordered List that serves as the tab menu. Each href of the menu corresponds to a tab content, ...

Tips for generating a fresh array by conditionally including an extra property based on the comparison of two arrays

I am working with two different arrays: lockers: [ { locker_id: 1, label: { size: 1, label: "small" } }, { locker_id: 2, label: { size: 3, label: "medium" } }, { locker_id: 3 ...

Terminate the rethinkdb data stream

Currently delving into the world of RethinkDB and am eager to utilize the changes() method to fetch a changefeed. While I've figured out how to initiate them, the documentation doesn't quite explain how to halt a changefeed. Is it sufficient to ...

Tips for displaying a close icon after completing a file upload

I need to implement a feature where once a user uploads a file, a cross sign should be enabled on the file. I attempted to use javascript for this functionality, but it seems to not be working as expected. There are more than 8-10 different file types that ...

Obtaining the pathname in a NextJS file like _document.js is a matter of accessing

I'm looking to retrieve the current URL path in my /page/_document.js file. I've created a class and my goal is to implement a conditional statement based on this value. Below is the code snippet (similar to the example provided in NextJS docume ...

How to enable real-time file changes detection in sails for development

I recently embarked on a new project using Sails (built on Express and Node.js). Currently, I am initiating my server with the command: sails lift However, whenever I make changes to the codebase, I need to manually restart the server. Is there a way to ...