aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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") {