Skip to content

Commit

Permalink
UBERF-9374 Disable HLS preload and hide loading spinner (#7992)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Onnikov <[email protected]>
  • Loading branch information
aonnikov authored Feb 12, 2025
1 parent f904f26 commit 3a5fbf6
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion plugins/view-resources/src/components/viewer/VideoViewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@
const meta = await getVideoMeta(value, name)
if (meta != null && meta.status === 'ready' && HLS.isSupported()) {
hls?.destroy()
hls = new HLS()
hls = new HLS({ autoStartLoad: false })
hls.loadSource(meta.hls)
hls.attachMedia(video)
video.poster = meta.thumbnail
video.onplay = () => {
// autoStartLoad disables autoplay, so we need to enable it manually
video.onplay = null
hls.startLoad()
}
} else {
video.src = src
}
Expand Down Expand Up @@ -64,3 +70,13 @@
>
<track kind="captions" label={name} />
</video>

<style lang="scss">
video::-webkit-media-controls {
visibility: hidden;
}
video::-webkit-media-controls-enclosure {
visibility: visible;
}
</style>

0 comments on commit 3a5fbf6

Please sign in to comment.