mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-29 11:11: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
@@ -52,6 +52,18 @@ export default function artplayerPluginAudioTrack(option) {
|
||||
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