Skip to content

Commit

Permalink
add api for language switching
Browse files Browse the repository at this point in the history
  • Loading branch information
iSchluff committed Apr 5, 2020
1 parent 7dae1b5 commit 6cdca65
Show file tree
Hide file tree
Showing 9 changed files with 575 additions and 12 deletions.
26 changes: 23 additions & 3 deletions dist/dash-shaka-playback.external.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion dist/dash-shaka-playback.external.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dash-shaka-playback.external.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dash-shaka-playback.external.min.js.map

Large diffs are not rendered by default.

525 changes: 522 additions & 3 deletions dist/dash-shaka-playback.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion dist/dash-shaka-playback.js.map

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion dist/dash-shaka-playback.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dash-shaka-playback.min.js.map

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions src/clappr-dash-shaka-playback.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ class DashShakaPlayback extends HTML5Video {
return this.isReady && this._player.getTextTracks()
}

get audioLanguages () {
return this.isReady && this._player.getAudioLanguages();
}

get audioTracks () {
return this.isReady && this._player.getVariantTracks().filter((t) => t.mimeType.startsWith('audio/'))
}
Expand All @@ -215,6 +219,10 @@ class DashShakaPlayback extends HTML5Video {
return (this.isReady && this._player.isLive() ? 'live' : 'vod') || ''
}

selectAudioLanguage (language, role=null) {
this._player.selectAudioLanguage(language, role);
}

selectTrack (track) {
if (track.type === 'text') {
this._player.selectTextTrack(track)
Expand Down Expand Up @@ -449,6 +457,7 @@ class DashShakaPlayback extends HTML5Video {
bandwidth: activeVideo.bandwidth,
width: activeVideo.width,
height: activeVideo.height,
language: activeVideo.language,
level: activeVideo.id,
bitrate: activeVideo.videoBandwidth
})
Expand Down

0 comments on commit 6cdca65

Please sign in to comment.