HLS VOD playback for browser (supplements MP4 proxy) #170

Open
zgaetano wants to merge 7 commits from feat/hls-vod-playback into main
Showing only changes of commit 01a19c0d69 - Show all commits

View file

@ -58,6 +58,9 @@ function AssetThumb({ asset, size = 'md' }) {
);
}
// VOD HLS assets: if we have an HLS rendition, we could potentially show a
// muted hover-preview here too. For now, just static thumb.
const altText = asset.name ? `Thumbnail for ${asset.name}` : 'Asset thumbnail';
return (
<div className="asset-thumb" style={{ background: 'var(--bg-2)', aspectRatio: aspect, overflow: 'hidden', position: 'relative' }}>
@ -112,7 +115,12 @@ function LiveThumb({ assetId, aspect }) {
const startHls = () => {
if (destroyed) return;
hls = new window.Hls({ liveSyncDurationCount: 2, lowLatencyMode: true, maxBufferLength: 10 });
hls = new window.Hls({
liveSyncDurationCount: 2,
lowLatencyMode: true,
maxBufferLength: 10,
xhrSetup: (xhr) => { xhr.withCredentials = true; }
});
hls.loadSource(url);
hls.attachMedia(v);
hls.on(window.Hls.Events.MANIFEST_PARSED, () => {