mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-09 04:35:25 +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}
|
||||
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
|
||||
video={videoRef.current}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user