Fixed rate not being respected after seeking

Referenced in issue => https://github.com/react-native-community/react-native-video/issues/763
This commit is contained in:
Alex Fox 2017-09-07 13:16:44 +01:00 committed by GitHub
parent f73b7a0484
commit 451f8d0919

View File

@ -561,7 +561,9 @@ static NSString *const timedMetadata = @"timedMetadata";
if (CMTimeCompare(current, cmSeekTime) != 0) { if (CMTimeCompare(current, cmSeekTime) != 0) {
if (!wasPaused) [_player pause]; if (!wasPaused) [_player pause];
[_player seekToTime:cmSeekTime toleranceBefore:tolerance toleranceAfter:tolerance completionHandler:^(BOOL finished) { [_player seekToTime:cmSeekTime toleranceBefore:tolerance toleranceAfter:tolerance completionHandler:^(BOOL finished) {
if (!wasPaused) [_player play]; if (!wasPaused) {
[self setPaused:false];
}
if(self.onVideoSeek) { if(self.onVideoSeek) {
self.onVideoSeek(@{@"currentTime": [NSNumber numberWithFloat:CMTimeGetSeconds(item.currentTime)], self.onVideoSeek(@{@"currentTime": [NSNumber numberWithFloat:CMTimeGetSeconds(item.currentTime)],
@"seekTime": [NSNumber numberWithFloat:seekTime], @"seekTime": [NSNumber numberWithFloat:seekTime],