-
Notifications
You must be signed in to change notification settings - Fork 792
Intelligent seeking over un-closeable buffer gaps - Part Deux #735
Conversation
'pause', | ||
'playing', | ||
'error' | ||
].forEach((event) => { |
There was a problem hiding this comment.
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.
579b873
to
d90d38c
Compare
…pose Made the logging easier to follow and less verbose
} | ||
|
||
this.player_ = videojs(options.tech.options_.playerId); | ||
this.tech_ = options.tech; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 = [ |
There was a problem hiding this comment.
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.
Some minor comments but otherwise LGTM |
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.