Skip to content

Commit

Permalink
Merge pull request #2464 from video-dev/bugfix/2438
Browse files Browse the repository at this point in the history
Prevent seeking to 0 when startPosition is -1
  • Loading branch information
robwalch committed Dec 6, 2019
2 parents 63efbc0 + 064e64f commit 9fa8f0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controller/stream-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ class StreamController extends BaseStreamController {
// at that stage, there should be only one buffered range, as we reach that code after first fragment has been buffered
const startPosition = media.seeking ? currentTime : this.startPosition;
// if currentTime not matching with expected startPosition or startPosition not buffered but close to first buffered
if (currentTime !== startPosition) {
if (currentTime !== startPosition && startPosition >= 0) {
// if startPosition not buffered, let's seek to buffered.start(0)
logger.log(`target start position not buffered, seek to buffered.start(0) ${startPosition} from current time ${currentTime} `);
media.currentTime = startPosition;
Expand Down

0 comments on commit 9fa8f0a

Please sign in to comment.