From 20c6bdd34b7c3387b6234c728c366c592e7fab21 Mon Sep 17 00:00:00 2001 From: 0xrohitgarg Date: Wed, 27 Nov 2024 17:22:01 +0530 Subject: [PATCH] remove endswith m3u8 check --- src/components/hooks/useVideoJSPlayer.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/hooks/useVideoJSPlayer.js b/src/components/hooks/useVideoJSPlayer.js index 1ece2d3..db9237a 100644 --- a/src/components/hooks/useVideoJSPlayer.js +++ b/src/components/hooks/useVideoJSPlayer.js @@ -15,12 +15,8 @@ export function usePlayer(emit, props) { const player = ref(null); const getSource = () => { - let src = props.streamUrl; - let type = "video/mp4"; - - if (src.endsWith("m3u8")) { - type = "application/x-mpegURL"; - } + const src = props.streamUrl; + const type = "application/x-mpegURL"; return { src, type }; }; @@ -163,7 +159,7 @@ export function usePlayer(emit, props) { playerState.playing = true; break; case "ended": - togglePlay() + togglePlay(); break; } emit(customEvent, { event });