fix(courseDetail): 修复视频播放逻辑和调整代码格式

调整视频播放逻辑,将事件监听移除和播放位置设置移到setTimeout外部
统一缩进格式,修复模板中的多余空格
This commit is contained in:
yindongqi 2025-08-01 15:50:34 +08:00
parent 608bcd0753
commit bd6ee74eaa

View File

@ -426,11 +426,11 @@ export default {
} }
function plays() { function plays() {
setTimeout(function () {
document.getElementById("video").removeEventListener("play", plays, false); document.getElementById("video").removeEventListener("play", plays, false);
document.getElementById("video").currentTime = _this.record; document.getElementById("video").currentTime = _this.record;
_this.current_sign = _this.record; _this.current_sign = _this.record;
Toast("从上次记录的地方开始播放"); Toast("从上次记录的地方开始播放");
setTimeout(function () {
_this.video_timer = setInterval(timer, 100); _this.video_timer = setInterval(timer, 100);
}, 1000); }, 1000);
} }