-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/ios buffer config #4
Conversation
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.
Looks good, but I didn't dive deep into how it should work according to Apple.
@@ -621,6 +641,23 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N | |||
} | |||
_playerBufferEmpty = NO; | |||
self.onVideoBuffer(@{@"isBuffering": @(NO), @"target": self.reactTag}); | |||
} else if ([keyPath isEqualToString:loadedTimeRangesKeyPath]) { | |||
if (_bufferConfig) { | |||
double buffered = [[self calculatePlayableDuration] doubleValue] - [[NSNumber numberWithFloat:CMTimeGetSeconds(_player.currentTime)] doubleValue]; |
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 line is not so readable
Made a PR to the original package here: TheWidlarzGroup#1353 Will see what feedback I get there as well |
Cool! @FrikkieSnyman What is the benefit of this over the Apple implementation? I tried to look for the Apple implementation in the docs but I couldn't find it. |
@jochem725 It should reduce the time-to-play on iOS. Currently, iOS determines if playback should start by looking at the likelihood that the buffering will keep up with the playback. This causes a considerable higher amount to be downloaded before playback starts. This implementation is similar to how the buffer config on Android works, as such that it will now only download the specified amount before playback starts, which should reduce our time-to-play the video on ios |
@FrikkieSnyman Nice :) |
Fix player crashing when it is being cleared.
Similar to the existing bufferconfig that exists for exo player, minus the functionality of
minBufferMs
andmaxBufferMs