Skip to content

Commit

Permalink
Fix a bug when switching between multiple thumbnail tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilhavy committed Apr 24, 2021
1 parent bce581e commit e05b3fd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contrib/akamai/controlbar/ControlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ var ControlBar = function (dashjsMediaPlayer, displayUTCTimeCodes) {
}
break;
case 'image-bitrate-list':
player.setQualityFor(self.mediaType, self.index);
player.setQualityFor(item.mediaType, item.index);
break;
case 'caption-list':
self.player.setTextTrack(item.index - 1);
Expand Down
5 changes: 5 additions & 0 deletions src/streaming/thumbnail/ThumbnailController.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ function ThumbnailController(config) {

function initialize() {
thumbnailTracks.addTracks();
const tracks = thumbnailTracks.getTracks();

if (tracks && tracks.length > 0) {
setTrackByIndex(0);
}
}

function getStreamId() {
Expand Down
1 change: 0 additions & 1 deletion src/streaming/thumbnail/ThumbnailTracks.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ function ThumbnailTracks(config) {
if (tracks.length > 0) {
// Sort bitrates and select the lowest bitrate rendition
tracks.sort((a, b) => a.bitrate - b.bitrate);
currentTrackIndex = tracks.length - 1;
}
}

Expand Down

0 comments on commit e05b3fd

Please sign in to comment.