diff --git a/src/view.web.tsx b/src/view.web.tsx index f679006..39c53ae 100644 --- a/src/view.web.tsx +++ b/src/view.web.tsx @@ -1,5 +1,6 @@ import type { HlsMediaConfig } from "@videojs/core/dom/media/hls-js"; import { HlsJsVideo } from "@videojs/react/media/hlsjs-video"; +import { Video } from "@videojs/react/video"; import { type CSSProperties, type RefObject, @@ -107,6 +108,11 @@ export const OmniView = ({ const ref = useRef(undefined!); const src = player.source?.src[0]; + const isHls = + src?.mimeType?.toLowerCase().includes("mpegurl") || + src?.uri.split(/[?#]/)[0]?.toLowerCase().endsWith(".m3u8") || + false; + const Tech = isHls ? HlsJsVideo : Video; const headersRef = useRef(src?.headers); headersRef.current = src?.headers; @@ -138,7 +144,7 @@ export const OmniView = ({ style={{ position: "relative", ...style }} > {src && ( - ))} - + )}