Skip to content

gigon/dash-shaka-playback

 
 

Repository files navigation

npm version license

For the older versions check

dash-shaka-playback

A clappr playback to play dash based on shaka-player.

CDN: https://cdn.jsdelivr.net/clappr.dash-shaka-playback/latest/dash-shaka-playback.js

NPM: https://www.npmjs.com/package/dash-shaka-playback/

dash shaka playback screenshot

Usage

<html>
  <head>
    <script src="https://cdn.jsdelivr.net/clappr/latest/clappr.min.js"></script>
    <script src="https://cdn.jsdelivr.net/clappr.dash-shaka-playback/latest/dash-shaka-playback.js"></script>
  </head>

  <body>
    <div id="player"></div>
    <script>
      var player = new Clappr.Player(
        {
          source: '//storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd',
          plugins: [DashShakaPlayback],
          shakaConfiguration: {
            preferredAudioLanguage: 'pt-BR',
            streaming: {
              rebufferingGoal: 15
            }
          },
          shakaOnBeforeLoad: function(shaka_player) {
            // shaka_player.getNetworkingEngine().registerRequestFilter() ...
          },
          parentId: '#player'
        });
    </script>
  </body>
</html>

DRM

If need to protect your content (DRM) you must use the shakaConfiguration following the shaka configuration need.

License Wrapping

If need to wrap DRM license requests or responses you use shakaOnBeforeLoad following shaka License Wrapping guide.

Development

Install dependencies:

npm install

Build:

npm run build

Run:

npm start

"extra" features

This playback offers you an API for handling with: audio, video and text tracks.

selectTrack(track)
textTracks()
audioTracks()
videoTracks()

About

A dash playback (based on shaka-player) for 🎬 Clappr

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 62.5%
  • HTML 27.0%
  • Shell 10.5%