Skip to content

Commit

Permalink
fix(xgplayer): fix progress cache update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangxin92 committed Sep 28, 2018
1 parent 559da3d commit fcdcc30
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/xgplayer/browser/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/xgplayer/dist/index.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions packages/xgplayer/src/control/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ progress = function () {
for (let i = 0, len = buffered.length; i < len; i++) {
if (player.currentTime >= buffered.start(i) && player.currentTime <= buffered.end(i)) {
end = buffered.end(i)
for (let j = i + 1; j < buffered.length; j++) {
if (buffered.start(j) - buffered.end(j - 1) >= 2) {
end = buffered.end(j - 1)
break
}
}
break
}
}
Expand Down

0 comments on commit fcdcc30

Please sign in to comment.