Giter Site home page Giter Site logo

playeravplaydrm's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

playeravplaydrm's Issues

Working example with Widevine Modular

Hi!

We are having some issues with the integration of Widevine Modular DRM using avplay.
Followed the example from this page: DRM Contents Playback Sequence, but even with the testing streams from Shaka demo samples we are getting "Invalid license challenge" 500 errors from the license servers. Same content works with Shaka player. There is some difference in how EME in the browser constructs the Challenge body and how avplay does it in "ondrmevent" callback, but it's hard to understand since it's base64 encoded (even after decoding it's still not readable).

Please provide working updated example of Widevine Modular integration.

Sample Dash Manifest URL: https://storage.googleapis.com/shaka-demo-assets/angel-one-widevine/dash.mpd
Sample Widevine License URL: https://cwip-shaka-proxy.appspot.com/no_auth
No custom headers needed, everything works with Shaka on this combination.

Brief example of how we do it in the code:

// Before prepareAsync
        drmParam.AppSession = uniqueId(); // random number
        drmParam.DataType = 'MPEG-DASH';

        if (parseInt(platformVersion, 10) >= 5) { // const {platformVersion} = tizen.systeminfo.getCapabilities();
          const STRINGIFIED_PARAMS = JSON.stringify(drmParam);

          webapis.avplay.setDrm(DRM_WIDEVINE, 'SetProperties', STRINGIFIED_PARAMS);
        } else {
          webapis.avplay.setDrm(DRM_WIDEVINE, 'Initialize', '');
          webapis.avplay.setDrm(DRM_WIDEVINE, 'widevine_app_session', drmParam.AppSession);
          webapis.avplay.setDrm(DRM_WIDEVINE, 'widevine_data_type', drmParam.DataType);
        }

// inside ondrmevent callback
            const decodedMessage = atob(drmData.challenge);

            const drmChallengeRequest = new XMLHttpRequest();

            drmChallengeRequest.responseType = 'arraybuffer';
            drmChallengeRequest.open('POST', this.licenseUrl, true);

            drmChallengeRequest.onload = function() {
              if (this.status === 200 && this.response) {
                const licenseParam = `${drmData.session_id}PARAM_START_POSITION${btoa(this.response)}PARAM_START_POSITION`;

                webapis.avplay.setDrm(DRM_WIDEVINE, 'widevine_license_data', licenseParam);
              } else {
                console.log('Error in license request');
              }
            };
            
            drmChallengeRequest.send(decodedMessage);

Here is the Diff of how Shaka player constructs license challenge request body, and how Tizen native player does that. First of all Tizen player doesn't detect TV model properly, and then there is a difference at the bottom of the request, but since it's unique at each request and encoded, it's impossible to understand which part of it is incorrect:
https://www.diffchecker.com/h8CZ5Y3X

how to implement verimatrix drm

how to implement verimatrix drm ?

I use these code:
var url = 'https://s3-us-west-1.amazonaws.com/integration-support/public_content/content_a/content_a.m3u8';
var host = 'ott-integration-1.verimatrix.com';
webapis.avplay.open(url);
var drmParam = new Object();
drmParam.CompanyName = CompanyName;
drmParam.IPTV = '';
drmParam.Web = host; //HOST IP
webapis.avplay.setDrm('VERIMATRIX', 'Initialize', JSON.stringify(drmParam));
webapis.avplay.prepareAsync(function(){webapis.avplay.play();});

and I got an error, drmEvent = "VERIMATRIX", drmData = Object {code: "4", message: "Createhandle/getrights/drmwebset/parserurl error", name: "DrmError"}

what does this error mean? how to modify my code to support verimatrix drm?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.