Skip to content

asergiychuk/dash-shaka-playback

 
 

Repository files navigation

npm version license

dash-shaka-playback

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

CDNJS: https://cdnjs.cloudflare.com/ajax/libs/dash-shaka-playback/2.0.5/dash-shaka-playback.js

(for some reason jsdelivr is not working) CDN JSDELIVR: https://cdn.jsdelivr.net/clappr.dash-shaka-playback/latest/dash-shaka-playback.js

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

Demo

dash shaka playback screenshot

Usage

<html>
  <head>
    <script src="https://cdn.jsdelivr.net/clappr/latest/clappr.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/dash-shaka-playback/2.0.7/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

Run dev. server :

npm start

By default, dev. server is listening on http://0.0.0.0:8080.

Build plugin:

npm run dist

By default, Shaka player is bundled with plugin. A "lightweight" version of this plugin, without shaka player bundled, dash-shaka-playback-external.min.js is available.

"extra" features

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

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

For the older versions check

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 69.4%
  • HTML 22.0%
  • Shell 8.6%