feat: simplify HLS instance handling in update function

This commit is contained in:
Harvey Zack committed 2024-09-22 16:29:23 +08:00
1 parent b9878e43e0
commit e3db4125b0
3 files changed
+7 -9

No files matched your search

@@ -250,10 +250,9 @@ function artplayerPluginHlsControl(option = {}) {
});
}
function update() {
const hls = art.hls || window.hls;
errorHandle(hls && hls.media === $video, 'Cannot find instance of HLS from "art.hls" or "window.hls"');
updateQuality(hls);
updateAudio(hls);
errorHandle(art.hls?.media === $video, 'Cannot find instance of HLS from "art.hls"');
updateQuality(art.hls);
updateAudio(art.hls);
}
art.on("ready", update);
art.on("restart", update);