Skip to content

Commit 1f6a09b

Browse files
committed
style: enhance playlist UI with flexbox layout and improved thumbnail dimensions
1 parent bf9a088 commit 1f6a09b

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

packages/video-player/javascript/modules/playlist/playlist-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class PlaylistManager {
124124
const isHorizontal = opts.widgetProps?.direction === 'horizontal';
125125

126126
if (isHorizontal) {
127-
const playlistHeight = Math.min(playerHeight * 0.25, 200);
127+
const playlistHeight = Math.min(playerHeight * 0.45, 200);
128128
this.playerContainer_.style.width = `${playerWidth}px`;
129129
this.playerContainer_.style.height = `${playerHeight + playlistHeight}px`;
130130
if (this.playlistMenu) {

packages/video-player/javascript/modules/playlist/styles/playlist-ui.scss

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
container-type: size;
102102

103103
.vjs-playlist-item {
104+
display: flex;
104105
width: 20%;
105106
height: 100%;
106107
flex-shrink: 0;
@@ -114,6 +115,7 @@
114115
padding-left: clamp(4px, 3%, 28px);
115116
--playlist-item-padding-left: clamp(4px, 3%, 28px);
116117
margin-bottom: 0;
118+
overflow: hidden;
117119

118120
@container (max-width: 600px) {
119121
padding-left: clamp(4px, 2%, 6px);
@@ -147,12 +149,16 @@
147149
}
148150

149151
.vjs-playlist-thumbnail {
150-
width: clamp(80px, 100%, 100%);
152+
height: calc(100% - clamp(40px, 50%, 80px) - clamp(4px, 3%, 8px) - clamp(4px, 2%, 6px) * 2);
153+
width: auto;
154+
aspect-ratio: 16 / 9;
155+
max-width: 100%;
156+
flex-shrink: 0;
151157
}
152-
158+
153159
.vjs-playlist-details {
154-
flex-grow: 0;
155-
min-height: clamp(40px, 50%, 80px);;
160+
flex: 0 0 clamp(40px, 50%, 80px);
161+
min-width: 0;
156162
}
157163
}
158164

0 commit comments

Comments
 (0)