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

Commit

Permalink
修改ci&修复视频播放结束重新播放的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Apr 6, 2019
1 parent 1ede43b commit 66070ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ before_install:

script:
- npm run pack
- cd build/cxmooc-tools && zip ../cxmooc-tools.zip -r ./
- cd build/cxmooc-tools && zip ../cxmooc-tools.zip -r ./ && cd ../../

deploy:
provider: releases
Expand Down
9 changes: 4 additions & 5 deletions src/cxmooc-tools/chaoxing/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,18 @@ module.exports = function () {
}
}
});

let end = false;
let tag = Math.random();
localStorage['now_video_tag'] = tag;
let pauseTimer = setInterval(function () {
//以防万一的暂停- -
if (!self.pause && !end) {
if (!self.pause && localStorage['now_video_tag'] == tag) {
self.video.paused && self.video.play();
} else {
} else if (localStorage['now_video_tag'] != tag) {
clearInterval(pauseTimer);
}
}, 10000);

$(self.video).on('ended', function () {
end = true;
if (undefined != self.complete) {
self.complete();
}
Expand Down

0 comments on commit 66070ad

Please sign in to comment.