Squashed commit of the following:

commit 6e6737a7c6
Author: joylink_zhaoerwei <Bob_Engineer@163.com>
Date:   Thu Mar 21 16:57:58 2024 +0800

    播放视频调整
This commit is contained in:
joylink_zhaoerwei 2024-03-21 17:28:59 +08:00
parent 506fcd481b
commit 06aef16a5d

View File

@ -6,7 +6,7 @@
:playsinline="false" :playsinline="false"
:options="playOptions" :options="playOptions"
@play="onPlayerPlay($event)" @play="onPlayerPlay($event)"
@timeupdate="onPlayerTimeupdate($event)" @pause="onPlayerPause($event)"
/> />
</div> </div>
</el-dialog> </el-dialog>
@ -69,6 +69,7 @@ export default {
}); });
}, },
handleClose() { handleClose() {
this.$refs.videoPlayer.player.pause();
this.dialogVisible = false; this.dialogVisible = false;
}, },
onPlayerPlay(player) { onPlayerPlay(player) {
@ -89,14 +90,6 @@ export default {
}, },
onPlayerPause(player) { onPlayerPause(player) {
this.playedTime = player.currentTime(); 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;
} }
} }
}; };