fix auto play

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 91e91fe5e8
commit 7e3e13ffbf
3 changed files with 6 additions and 15 deletions

View File

@@ -111,6 +111,7 @@
if (currentTime > 0) {
replayer.resume(currentTime);
} else {
this.set({ isPlaying: true });
replayer.play(currentTime);
}
},
@@ -135,8 +136,10 @@
onupdate({ changed, current, previous }) {
if (current.replayer && !previous) {
// auto play
this.set({ isPlaying: true });
this.play();
setTimeout(() => {
this.set({ isPlaying: true });
}, 0);
current.replayer.play(0);
current.replayer.on('pause', () => {
this.set({ isPlaying: false });
});