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

Intelligent seeking over un-closeable buffer gaps - Part Deux #735

Merged
merged 35 commits into from
Jun 29, 2016

Conversation

imbcmdth
Copy link
Member

@imbcmdth imbcmdth commented Jun 8, 2016

Skip over gaps after giving the HLS library adequate time to try and close the gap. The idea is to emulate safari's behavior of "playing through" any missing segments. Instead of playing through them, we will wait the duration of the gap before seeking to the next region of the buffer containing video data.

Based on #697 but with some fixes and minor refactors to make it more robust and use fewer tracking state-variables.

'pause',
'playing',
'error'
].forEach((event) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can actually pass an array of events to on, so we won't have to loop over them here.

}

this.player_ = videojs(options.tech.options_.playerId);
this.tech_ = options.tech;
Copy link
Member

Choose a reason for hiding this comment

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

This member variable is never used. In general, we should be try to minimize dependencies on the player and techs. They're both really complex, stateful objects and they're shared among many different actors. Definitely don't store it if you're not going to use it.

Copy link
Member

Choose a reason for hiding this comment

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

It seems like you could get away with using only the tech and skipping the player reference here. Given this is going to be used by the Source Handler, it seems like only referencing the tech would be preferable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Very true.

};

// Set of events that reset the gap-skipper logic and clear the timeout
let timerCancelEvents = [
Copy link
Member

Choose a reason for hiding this comment

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

This could be a const and moved out of the constructor.

@dmlap
Copy link
Member

dmlap commented Jun 24, 2016

Some minor comments but otherwise LGTM

@imbcmdth imbcmdth merged commit 56cb874 into master Jun 29, 2016
@imbcmdth imbcmdth deleted the gap-skipper branch June 29, 2016 20:22
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.

3 participants