mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-10 05:05:26 +03:00
Switch to hls.js on error
This commit is contained in:
parent
88ae21b34a
commit
fea09b51a8
@ -179,6 +179,16 @@ export default function HlsVideoPlayer({
|
|||||||
}
|
}
|
||||||
onLoadedData={onPlayerLoaded}
|
onLoadedData={onPlayerLoaded}
|
||||||
onEnded={onClipEnded}
|
onEnded={onClipEnded}
|
||||||
|
onError={(e) => {
|
||||||
|
if (
|
||||||
|
// @ts-expect-error code does exist
|
||||||
|
e.target.error.code == MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED &&
|
||||||
|
videoRef.current
|
||||||
|
) {
|
||||||
|
hlsRef.current = new Hls();
|
||||||
|
hlsRef.current.attachMedia(videoRef.current);
|
||||||
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<VideoControls
|
<VideoControls
|
||||||
video={videoRef.current}
|
video={videoRef.current}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user