mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 06:31:20 -08:00
fix: reset playback state on play after ended and emit additional events on video end
This commit is contained in:
1 parent
e45bc1ef20
commit
7d8034ca18
4 files changed
+15
-3
No files matched your search
@@ -616,7 +616,10 @@ function createMediabunnyEngine({ canvas, ctx, events, option = {} }) {
|
||||
}
|
||||
async function play() {
|
||||
if (!_paused) return;
|
||||
_ended = false;
|
||||
if (_ended) {
|
||||
_ended = false;
|
||||
await seek(0);
|
||||
}
|
||||
_paused = false;
|
||||
await audio.play();
|
||||
video.start(audio);
|
||||
@@ -16554,7 +16557,10 @@ function createVideoEngine({ canvas, ctx, events, timeupdateInterval = 250, avSy
|
||||
}
|
||||
if (Number.isFinite(_duration) && t >= _duration) {
|
||||
stop();
|
||||
stalled = false;
|
||||
events.emit('ended');
|
||||
events.emit('pause');
|
||||
events.emit('canplay');
|
||||
return;
|
||||
}
|
||||
if (nextFrame && nextFrame.timestamp <= t) {
|
||||
|
||||
Reference in new issue
Block a user