mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-10 13:15:25 +03:00
Adjust hls compat approach
This commit is contained in:
parent
d3f221be5c
commit
dd8e83aeea
@ -10,7 +10,6 @@ import { isDesktop, isMobile } from "react-device-detect";
|
|||||||
import { TransformComponent, TransformWrapper } from "react-zoom-pan-pinch";
|
import { TransformComponent, TransformWrapper } from "react-zoom-pan-pinch";
|
||||||
import VideoControls from "./VideoControls";
|
import VideoControls from "./VideoControls";
|
||||||
|
|
||||||
const USE_NATIVE_HLS = false;
|
|
||||||
const HLS_MIME_TYPE = "application/vnd.apple.mpegurl" as const;
|
const HLS_MIME_TYPE = "application/vnd.apple.mpegurl" as const;
|
||||||
const unsupportedErrorCodes = [
|
const unsupportedErrorCodes = [
|
||||||
MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED,
|
MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED,
|
||||||
@ -52,7 +51,7 @@ export default function HlsVideoPlayer({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (USE_NATIVE_HLS && videoRef.current.canPlayType(HLS_MIME_TYPE)) {
|
if (videoRef.current.canPlayType(HLS_MIME_TYPE)) {
|
||||||
return;
|
return;
|
||||||
} else if (Hls.isSupported()) {
|
} else if (Hls.isSupported()) {
|
||||||
setUseHlsCompat(true);
|
setUseHlsCompat(true);
|
||||||
@ -157,6 +156,7 @@ export default function HlsVideoPlayer({
|
|||||||
unsupportedErrorCodes.includes(e.target.error.code) &&
|
unsupportedErrorCodes.includes(e.target.error.code) &&
|
||||||
videoRef.current
|
videoRef.current
|
||||||
) {
|
) {
|
||||||
|
setLoadedMetadata(false);
|
||||||
setUseHlsCompat(true);
|
setUseHlsCompat(true);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user