播放视频调整
This commit is contained in:
parent
7971fce1b6
commit
6e6737a7c6
@ -6,7 +6,7 @@
|
||||
:playsinline="false"
|
||||
:options="playOptions"
|
||||
@play="onPlayerPlay($event)"
|
||||
@timeupdate="onPlayerTimeupdate($event)"
|
||||
@pause="onPlayerPause($event)"
|
||||
/>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -69,6 +69,7 @@ export default {
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
this.$refs.videoPlayer.player.pause();
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
onPlayerPlay(player) {
|
||||
@ -89,14 +90,6 @@ export default {
|
||||
},
|
||||
onPlayerPause(player) {
|
||||
this.playedTime = player.currentTime();
|
||||
},
|
||||
onPlayerTimeupdate(player) {
|
||||
const timeDisplay = player.currentTime();
|
||||
if (timeDisplay - this.currentTime > 1) {
|
||||
player.currentTime(this.currentTime > this.maxTime ? this.currentTime : this.maxTime);
|
||||
}
|
||||
this.currentTime = player.currentTime();
|
||||
this.maxTime = this.currentTime > this.maxTime ? this.currentTime : this.maxTime;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user