Skip to content

Commit

Permalink
Fix some problems when there are no thumbnails in stream (#3302)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremco committed Jun 18, 2020
1 parent d2c6b78 commit b2ab049
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/akamai/controlbar/ControlBar.js
Expand Up @@ -579,7 +579,7 @@ var ControlBar = function (dashjsMediaPlayer, displayUTCTimeCodes) {
el = createMenuContent(el, getMenuContent(menuType, info.audio, contentFunc), 'audio', 'audio-' + menuType + '-list');
setMenuItemsState(getMenuInitialIndex(info.audio, menuType, 'audio'), 'audio-' + menuType + '-list');
}
if (info.images.length > 1) {
if (info.images && info.images.length > 1) {
el.appendChild(createMediaTypeMenu('image'));
el = createMenuContent(el, getMenuContent(menuType, info.images, contentFunc, false), 'image', 'image-' + menuType + '-list');
setMenuItemsState(getMenuInitialIndex(info.images, menuType, 'image'), 'image-' + menuType + '-list');
Expand Down
3 changes: 3 additions & 0 deletions src/streaming/MediaPlayer.js
Expand Up @@ -1665,16 +1665,19 @@ function MediaPlayer() {
}
if (time < 0) {
callback(null);
return;
}
const s = playbackController.getIsDynamic() ? getDVRSeekOffset(time) : time;
const stream = streamController.getStreamForTime(s);
if (stream === null) {
callback(null);
return;
}

const thumbnailController = stream.getThumbnailController();
if (!thumbnailController) {
callback(null);
return;
}

const timeInPeriod = streamController.getTimeRelativeToStreamId(s, stream.getId());
Expand Down

0 comments on commit b2ab049

Please sign in to comment.