Git Product home page Git Product logo

oneplayercore_gettingstarted's Introduction

OnePlayerCore_GettingStarted

Focus :

The links to the player will be provided to you by Akamai (CDN) as below :

$ https://static.canal-overseas.com/player/prod/playerCore/v2/one-player-core.js
$ https://static.canal-overseas.com/player/prod/playerCore/v2/one-player-core.min.js

for the old version of chrome (<52):

$ https://static.canal-overseas.com/player/prod/playerCore/one-player-core.js
$ https://static.canal-overseas.com/player/prod/playerCore/one-player-core.min.js

for more details about implementation of our player please see there or check our repo

if you don't have right try this one Rx-player which is our Open source version.

The one-player-core is a Javascript library implementic a generic streaming video player using HTML5 Media Source and Encrypted Media extensions. It is entirely written in reactive-programming with ECMAScript 6.

It comes with a support for DASH and SmoothStreaming transports.

see the API of player for more interaction Read the detailed API.

This allowed us to implement some nice features quite easily. For instance, because in the one-player-core all asynchronous tasks are encapsulated in observable data-structures, we were able to add a transparent retry system with a simple observable operator to declaratively handle any failure and replay the whole process.

Another example is the way we abstracted our transport layer into an observable pipeline, allowing us to support different type of streaming systems with its own asynchronous specifities. And because one-player-core is message-driven, this encapsulation allows us isolate the transport I/O into a WebWorker without any effort, or add an offline support for any pipeline implementation.

Sample

in a video tag you just have to set an identifier and launch one-player-core on it :

    <video id="videoEl" controls></video>

to launch one-player-core , you must

    var player = new RxPlayer({
      videoElement: document.getElementById("videoEl"),
    });

You must set some parameters like :

var keySystems = [
      {
        type: "widevine",
        getLicense: function getLicense(challenge) {
          return request({
            method: "POST",
            url: "https://vod-authorization.canal-overseas.com/vod/play/wvX1?eck=X1",
            data: btoa(bytesToStr(challenge)),
            headers: {
              mediaPackId: "subscription-c-ald",
              optionId: "streaming",
              productId: "1186603_1"
            },
            format: "json",
          })
          .map(function (response) {
            return strToBytes(atob(response.licence));
          });
        }
      }
  ]

player.loadVideo(
  {
  "url": "http://hss-vod-aka.canal-overseas.com/vod/assets/subscription-c-ald_1186603_1/_/hss-wv-cp-drom-hd/Manifest",
  "transport": "smooth",
  "keySystems": keySystems,
  "live": true,
})

player.play();

The requests function is a custom implementation, look the sample file for more detail.

Run it :

You must have a client certificat or use a X1 ( cube C ) to get licence by our DRM platform. Or you must have a tokenId ( take it on canalplus-{zone}.com )

oneplayercore_gettingstarted's People

Contributors

frankakouemo avatar

Watchers

 avatar  avatar

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.