
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/

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: 'https://shaka-player-demo.appspot.com/assets/angel_one.mpd?_=1446383792251',
plugins: {
playback: [DashShakaPlayback]
},
parentId: '#player'
});
</script>
</body>
</html>
DRM
If need to protect your content (DRM) you need to provide a callback for it.
var player = new Clappr.Player(
{
source: 'https://shaka-player-demo.appspot.com/assets/angel_one.mpd?_=1446383792251',
plugins: {
playback: [DashShakaPlayback]
},
shaka: {
interpretContentProtection: myInterpretCallback
}
parentId: '#player'
});
The interpretContentProtection
callback spec:
function interpretContentProtection (schemeIdUri, contentProtection) {
}
You need to provide a function which receives: the content protection scheme id schemeIdUri
and the content protection element contentProtection
and it must return an array of DRMInfo Config. You can see an example at shaka tutorial for License Request Pre-processing and License Response Post-processing.
Development
Install dependencies:
npm install
Build:
npm run build
Run:
npm start
This playback offers you an API for handling with: audio, video and text tracks.
enableTextTrack(state)
textTracks()
selectTextTrack(id)
audioTracks()
selectAudioTrack(id)
videoTracks()
selectVideoTrack(id)
observations
This playback supports the browsers that shaka does and it also has the same content restrictions.