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 May 7, 2020
1 parent 7dae1b5 commit 6dcb68c
Showing 1 changed file with 9 additions and 0 deletions.
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 6dcb68c

Please sign in to comment.