videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
38.01k stars 7.45k forks source link

Not able to play widevine drm protected content #1 #8387

Open JoyAthira opened 1 year ago

JoyAthira commented 1 year ago

Description

      <script src="https://vjs.zencdn.net/7.4.1/video.js"></script> <script src="https://unpkg.com/videojs-contrib-eme/dist/videojs-contrib-eme.js"></script>
var player = videojs('example-video', { aspectRatio: '16:9', fluid: true, controls: false, autoplay: true, muted: false, html5: {
      }
    });
var style = document.createElement('style');
style.innerHTML = '.video-js .vjs-control-bar { height: 50px; }';
document.head.appendChild(style);

function drmPlay(videoUrl) {

  const licenseHeaders = getLicenseHeadersFromURL();

  player.src({
      type: 'application/dash+xml',
      src: videoUrl.mediaUrl,

  keySystemOptions: [{
      name: 'com.widevine.alpha',
      options: {
        serverURL: 'https://viewway.ap-south-1.conax.cloud:443/widevine/license',
        httpRequestHeaders: {
          customdata: licenseHeaders

    }
      }
    }]
});

}
function getLicenseHeadersFromURL() {
const params = new URLSearchParams(window.location.search);
const encodedLicenseHeaders = params.get('licenseHeaders');
if (encodedLicenseHeaders) {
return JSON.parse(decodeURIComponent(encodedLicenseHeaders));
}
return null;
}

can some help to figured out what am missing here?want to play drm protected content with custom data

Reduced test case

http://45.249.171.148/chome_02/mazhavilmanoramahd/index.mpd

Steps to reproduce

1. 2. 3.

Errors

No response

What version of Video.js are you using?

7.4.1

Video.js plugins used.

<script src="https://vjs.zencdn.net/7.4.1/video.js"></script>

What browser(s) including version(s) does this occur with?

Chrome 115

What OS(es) and version(s) does this occur with?

windows 11

welcome[bot] commented 1 year ago

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.