Skip to content
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

Merged
merged 3 commits into from
Nov 28, 2018
Merged

Feat/ios buffer config #4

merged 3 commits into from
Nov 28, 2018

Conversation

FrikkieSnyman
Copy link
Collaborator

Similar to the existing bufferconfig that exists for exo player, minus the functionality of minBufferMs and maxBufferMs

Copy link

@RalfNieuwenhuizen RalfNieuwenhuizen 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 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];

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

@FrikkieSnyman FrikkieSnyman merged commit 4cbc4c2 into master Nov 28, 2018
@FrikkieSnyman
Copy link
Collaborator Author

Made a PR to the original package here: TheWidlarzGroup#1353

Will see what feedback I get there as well

@jochem725
Copy link

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.

@FrikkieSnyman
Copy link
Collaborator Author

@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

@jochem725
Copy link

@FrikkieSnyman Nice :)

jaspermeijaard pushed a commit that referenced this pull request Jun 24, 2022
Fix player crashing when it is being cleared.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants