Commit d020069c authored by liujiangnan's avatar liujiangnan

fix: 进度条

parent 5238f44f
...@@ -88,6 +88,10 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni ...@@ -88,6 +88,10 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
this.player.onpause = () => { this.player.onpause = () => {
this.isPlaying = false; this.isPlaying = false;
}; };
this.player.addEventListener("ended", () => {
this.refresh();
})
setTimeout(() => { setTimeout(() => {
this.initCover = this.data.contentObj.pic_id; this.initCover = this.data.contentObj.pic_id;
}); });
...@@ -125,6 +129,8 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni ...@@ -125,6 +129,8 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
const player = event.target; const player = event.target;
this.currentTime = player.currentTime; this.currentTime = player.currentTime;
this.progress = Math.floor((player.currentTime / player.duration) * 100); this.progress = Math.floor((player.currentTime / player.duration) * 100);
this.duration = this.player.duration;
} }
onBtnQuickSeek(delta: number) { onBtnQuickSeek(delta: number) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment