Skip to content
This repository was archived by the owner on Apr 25, 2022. It is now read-only.

Commit 66070ad

Browse files
committed
修改ci&修复视频播放结束重新播放的bug
1 parent 1ede43b commit 66070ad

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ before_install:
2121

2222
script:
2323
- npm run pack
24-
- cd build/cxmooc-tools && zip ../cxmooc-tools.zip -r ./
24+
- cd build/cxmooc-tools && zip ../cxmooc-tools.zip -r ./ && cd ../../
2525

2626
deploy:
2727
provider: releases

src/cxmooc-tools/chaoxing/video.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,18 @@ module.exports = function () {
9090
}
9191
}
9292
});
93-
94-
let end = false;
93+
let tag = Math.random();
94+
localStorage['now_video_tag'] = tag;
9595
let pauseTimer = setInterval(function () {
9696
//以防万一的暂停- -
97-
if (!self.pause && !end) {
97+
if (!self.pause && localStorage['now_video_tag'] == tag) {
9898
self.video.paused && self.video.play();
99-
} else {
99+
} else if (localStorage['now_video_tag'] != tag) {
100100
clearInterval(pauseTimer);
101101
}
102102
}, 10000);
103103

104104
$(self.video).on('ended', function () {
105-
end = true;
106105
if (undefined != self.complete) {
107106
self.complete();
108107
}

0 commit comments

Comments
 (0)