Git Product home page Git Product logo

react-drm-player's Introduction

React DRM Player

npm

Introduction

@gumlet/react-drm-player is a simple player which supoprts DRM. It uses shaka-player to play your DRM protected video playback if your browser supports html 5 video and MediaSource Extension.

npm i @gumlet/react-drm-player

The player automatically detects fairplay or widevine playback.

Example

Using the ReactDRMPlayer component

import './App.css';
import ReactDRMPlayer from '@gumlet/react-drm-player';

function App() {
  return (
    <div className="App">
      <ReactDRMPlayer 
        src={`<YOUR DRM PROTECTED HLS/DASH URI>`} 
        fairplayCertificateURI={`<YOUR FAIRPLAY CERTIFICATE URI>`}
        fairplayLicenseURI={`<YOUR PAIRPLAY LICENSE URI>`}

        widevineLicenseURI={`<YOUR WIDEVINE LICENSE URI>`}
        width="640" 
        height="264" 
        controls 
        muted
        preload="none"
        autoPlay={false}
      />
    </div>
  );
}

export default App;

Props

All video properties are supported and passed down to the underlying video component

Prop Description
src String, required The DRM protected video url that you want to play
fairplayCertificateURI String, required URL of the server which returns the fairplay certificate
fairplayLicenseURI String, required URL of the server which returns the fairplay license
widevineLicenseURI String, required URL of the server which returns the widevine license
autoPlay Boolean Autoplay when component is ready. Defaults to false
controls Boolean Whether or not to show the playback controls. Defaults to false
width Number Video width. Defaults to 100%
height Number Video height. Defaults to auto
onPlayerError Callback Callback to be called when the player experiences an error during player startup and setup
onPlaybackError Callback Callback to be called when the playback experiences an error during ongoing video playback

Maintainer

This library is maintained by Gumlet.com

react-drm-player's People

Contributors

mudit2108 avatar adityapatadia 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.