aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFactiven <[email protected]>2023-05-02 00:07:02 +0700
committerFactiven <[email protected]>2023-05-02 00:07:02 +0700
commited16532a7d1170e7945a38ba02e2220da45b2a8f (patch)
tree849be2bd11201bf8699119e6034be0e305220586 /lib
parentUpdate v3.5.2 (diff)
downloadmoopa-ed16532a7d1170e7945a38ba02e2220da45b2a8f.tar.xz
moopa-ed16532a7d1170e7945a38ba02e2220da45b2a8f.zip
Fixed CORS issue fr fr
Diffstat (limited to 'lib')
-rw-r--r--lib/Artplayer.js9
1 files changed, 2 insertions, 7 deletions
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") {