mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 17:01:20 -08:00
feat: enhance audio track plugin with waiting and playing event handling
This commit is contained in:
1 parent
ece55c5747
commit
23a20d5d6d
5 files changed
+23
-3
No files matched your search
@@ -246,6 +246,14 @@ function artplayerPluginAudioTrack(option) {
|
||||
audio.volume = art.volume;
|
||||
audio.muted = art.muted;
|
||||
});
|
||||
art.on('video:waiting', ()=>{
|
||||
audio.pause();
|
||||
});
|
||||
art.on('video:playing', ()=>{
|
||||
if (url && art.playing) audio.play().catch((err)=>{
|
||||
console.warn(err);
|
||||
});
|
||||
});
|
||||
art.on('destroy', ()=>{
|
||||
audio.pause();
|
||||
audio.src = '';
|
||||
|
||||
Reference in new issue
Block a user