Skip to content
This repository was archived by the owner on Sep 28, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,14 @@ audioTracks()
videoTracks()
```

# HLS

By default, HLS streams are handled by clappr. If you want that shaka handle HLS streams enable in the plugin list:

```javascript
...
plugins: [DashShakaPlayback.withHls()],
...
```

# For the older versions [check](https://github.com/clappr/dash-shaka-playback/tree/releases)
7 changes: 6 additions & 1 deletion src/clappr-dash-shaka-playback.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ class DashShakaPlayback extends HTML5Video {
shaka.polyfill.installAll()
var browserSupported = shaka.Player.isBrowserSupported()
var resourceParts = resource.split('?')[0].match(/.*\.(.*)$/) || []
return browserSupported && ((resourceParts[1] === 'mpd') || mimeType.indexOf('application/dash+xml') > -1)
return browserSupported && ((resourceParts[1] === 'mpd') || mimeType.indexOf('application/dash+xml') > -1 || (DashShakaPlayback._enableHls && ((resourceParts[1] === 'm3u8') || mimeType === 'application/x-mpegURL' || mimeType === 'application/vnd.apple.mpegurl' )))
}

static withHls(isEnabled=true) {
DashShakaPlayback._enableHls = !!isEnabled
return DashShakaPlayback
}

get name () {
Expand Down