mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-22 05:11:20 -08:00
feat: simplify HLS instance handling in update function
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user