Description
I have been having an issue where once shaka gets into a buffering state, it will not stop buffering until I click play again. After some investigation I have determined it was because of the buffer size i gave the player. I want to buffer ahead as much as possible so i set the buffer size to be around 10 minutes (so playing back at faster speeds involves less buffering). This works find and dandy on startup as playback starts immediately and my client will download 10 minutes worth of future video chunks. However when shaka enters the buffering state, it will not exit this state until that entire 10 minutes worth of buffer is filled.
var bufferingGoal = this.videoSource_.getBufferingGoal();
if (buffered > bufferingGoal) {
this.endBufferingState_();
this.video_.play();
}
I recommend either splitting the buffering configuration into a maxBufferSize and a targetBufferSize (where targetBufferSize is the threshold needed before playback is resumed) or using something like
if (buffered > shaka.player.Player.UNDERFLOW_THRESHOLD_)
to resume playback