Skip to content

Commit d49b3ba

Browse files
Set max height for storyboards depending on window width (#4933)
* Pick largest storyboard that is less than 90px tall * Reduce storyboard size when window inner width is below 500 * Reduce code * Only check the window inner width once to avoid messing with the video player internals for storyboards * Add back deleted line * Add back trailing comma
1 parent e659462 commit d49b3ba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/renderer/views/Watch/Watch.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,11 @@ export default defineComponent({
697697
}
698698

699699
if (result.storyboards?.type === 'PlayerStoryboardSpec') {
700-
this.createLocalStoryboardUrls(result.storyboards.boards.at(-1))
700+
let source = result.storyboards.boards
701+
if (window.innerWidth < 500) {
702+
source = source.filter((board) => board.thumbnail_height <= 90)
703+
}
704+
this.createLocalStoryboardUrls(source.at(-1))
701705
}
702706
}
703707

0 commit comments

Comments
 (0)