Skip to content

Commit 1f336dd

Browse files
authored
fix(UI): Optimize portrait thumbnail display (#8274)
Fixes #8272
1 parent 2f18b47 commit 1f336dd

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

ui/less/thumbnails.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
right: 0;
2525
text-align: center;
2626
}
27+
28+
&.portrait-thumbnail {
29+
min-width: 75px;
30+
width: 7.5%;
31+
}
2732
}
2833

2934
#shaka-player-ui-time-container {

ui/seek_bar.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,11 @@ 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.width < thumbnail.height) {
550+
this.thumbnailContainer_.classList.add('portrait-thumbnail');
551+
} else {
552+
this.thumbnailContainer_.classList.remove('portrait-thumbnail');
553+
}
549554
if (!thumbnail || !thumbnail.uris.length) {
550555
this.hideThumbnail_();
551556
return;

0 commit comments

Comments
 (0)