From d020069cb279162cf341fad4d14b3870b2ad6d46 Mon Sep 17 00:00:00 2001 From: liujiangnan <695541723@qq.com> Date: Sun, 9 Aug 2020 19:28:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=9B=E5=BA=A6=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/play/play.component.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/play/play.component.ts b/src/app/play/play.component.ts index efa19ff..ad82e60 100644 --- a/src/app/play/play.component.ts +++ b/src/app/play/play.component.ts @@ -88,6 +88,10 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni this.player.onpause = () => { this.isPlaying = false; }; + + this.player.addEventListener("ended", () => { + this.refresh(); + }) setTimeout(() => { this.initCover = this.data.contentObj.pic_id; }); @@ -125,6 +129,8 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni const player = event.target; this.currentTime = player.currentTime; this.progress = Math.floor((player.currentTime / player.duration) * 100); + + this.duration = this.player.duration; } onBtnQuickSeek(delta: number) { -- 2.21.0