Skip to content

Commit 9010483

Browse files
authored
fix(UI): Fix thumbnail exception when the thumbnails doesn't exist (#8318)
Fixes #8317
1 parent 4cd088d commit 9010483

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ui/seek_bar.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -546,15 +546,15 @@ shaka.ui.SeekBar = class extends shaka.ui.RangeElement {
546546
Math.min(Math.floor(seekRange.end), value));
547547
const thumbnail =
548548
await this.player.getThumbnails(/* trackId= */ null, playerValue);
549+
if (!thumbnail || !thumbnail.uris.length) {
550+
this.hideThumbnail_();
551+
return;
552+
}
549553
if (thumbnail.width < thumbnail.height) {
550554
this.thumbnailContainer_.classList.add('portrait-thumbnail');
551555
} else {
552556
this.thumbnailContainer_.classList.remove('portrait-thumbnail');
553557
}
554-
if (!thumbnail || !thumbnail.uris.length) {
555-
this.hideThumbnail_();
556-
return;
557-
}
558558
if (this.player.isLive()) {
559559
const totalSeconds = seekRange.end - value;
560560
if (totalSeconds < 1) {

0 commit comments

Comments
 (0)