From ebbba606ca3d5b2c35d8cb2d7d59d2aad1955dd7 Mon Sep 17 00:00:00 2001 From: mmyduckx <308303735@qq.com> Date: Thu, 20 Jul 2023 16:33:16 +0800 Subject: [PATCH] Fix videoplayer status after pause&finish (#15782) * fix videoplayer.isplaying status after pause * fix isPlaying status when play video finish --- cocos/video/video-player-impl.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/video/video-player-impl.ts b/cocos/video/video-player-impl.ts index ac921c4828..cc9a4ba7d6 100644 --- a/cocos/video/video-player-impl.ts +++ b/cocos/video/video-player-impl.ts @@ -163,11 +163,11 @@ export abstract class VideoPlayerImpl { } public onPause (e: Event): void { + this._playing = false; if (this._ignorePause) { this._ignorePause = false; return; } - this._playing = false; this.dispatchEvent(EventType.PAUSED); } @@ -178,6 +178,7 @@ export abstract class VideoPlayerImpl { } public onEnded (e: Event): void { + this._playing = false; this.dispatchEvent(EventType.COMPLETED); } @@ -193,7 +194,6 @@ export abstract class VideoPlayerImpl { } } - // public play (): void { if (this._loadedMeta || this._loaded) { this.canPlay();