From ed16532a7d1170e7945a38ba02e2220da45b2a8f Mon Sep 17 00:00:00 2001 From: Factiven Date: Tue, 2 May 2023 00:07:02 +0700 Subject: Fixed CORS issue fr fr --- lib/Artplayer.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/Artplayer.js b/lib/Artplayer.js index ae7b88c..33acf21 100644 --- a/lib/Artplayer.js +++ b/lib/Artplayer.js @@ -6,14 +6,12 @@ export default function Player({ option, getInstance, ...rest }) { const artRef = useRef(); function playM3u8(video, url, art) { if (Hls.isSupported()) { + if (art.hls) art.hls.destroy(); const hls = new Hls(); hls.loadSource(url); hls.attachMedia(video); - - // optional art.hls = hls; - art.once("url", () => hls.destroy()); - art.once("destroy", () => hls.destroy()); + art.on("destroy", () => hls.destroy()); } else if (video.canPlayType("application/vnd.apple.mpegurl")) { video.src = url; } else { @@ -34,9 +32,6 @@ export default function Player({ option, getInstance, ...rest }) { lock: true, autoOrientation: true, theme: "#f97316", - icons: { - state: "", - }, }); if (getInstance && typeof getInstance === "function") { -- cgit v1.2.3