Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

always activate loading in segment loaders after a seek #1234

Merged
merged 2 commits into from
Aug 16, 2017

Conversation

mjneil
Copy link
Contributor

@mjneil mjneil commented Aug 14, 2017

Description

After the video has ended the player goes into a paused state. If you try and seek anywhere in the video after this, the player is still paused, so the SegmentLoaders do not being loading again. This results in the user seeing a loading spinner and black screen until they hit play. What should happen is the player begins loading segments at the new seek position and append to the buffer so the first frame of the position is displayed.

@@ -2780,7 +2780,7 @@ QUnit.test('cleans up the buffer when loading VOD segments', function(assert) {
this.clock.tick(1);
this.player.currentTime(120);
this.player.tech_.hls.mediaSource.sourceBuffers[0].trigger('updateend');
this.clock.tick(1);
this.clock.tick(2);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was needed because previously, after an updateend event, SegmentLoader.handleUpdateEnd_ would call SegmentLoader.monitorBuffer_ which would setup a timeout to call SegmentLoader.fillBuffer_ on the next clock tick, but with the addition of calling load on a seek, this would clear that timeout and set a new one for the next clock tick.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be good to add as a comment above the clock tick (since clock ticks are generally pretty mysterious through our tests).

Copy link
Contributor

@gesinger gesinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but we'll have to do plenty of testing around this.

@@ -2780,7 +2780,7 @@ QUnit.test('cleans up the buffer when loading VOD segments', function(assert) {
this.clock.tick(1);
this.player.currentTime(120);
this.player.tech_.hls.mediaSource.sourceBuffers[0].trigger('updateend');
this.clock.tick(1);
this.clock.tick(2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be good to add as a comment above the clock tick (since clock ticks are generally pretty mysterious through our tests).

@mjneil mjneil merged commit 6aef4ad into videojs:master Aug 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants