1.0.2 • Published 1 year ago

@gumlet/react-drm-player v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

PropDescription
src String, requiredThe DRM protected video url that you want to play
fairplayCertificateURI String, requiredURL of the server which returns the fairplay certificate
fairplayLicenseURI String, requiredURL of the server which returns the fairplay license
widevineLicenseURI String, requiredURL of the server which returns the widevine license
autoPlay BooleanAutoplay when component is ready. Defaults to false
controls BooleanWhether or not to show the playback controls. Defaults to false
width NumberVideo width. Defaults to 100%
height NumberVideo height. Defaults to auto
onPlayerError CallbackCallback to be called when the player experiences an error during player startup and setup
onPlaybackError CallbackCallback to be called when the playback experiences an error during ongoing video playback

Maintainer

This library is maintained by Gumlet.com

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago