Skip to content

Commit

Permalink
Implement pending seek
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshandersson committed May 7, 2020
1 parent 838b99a commit 213bb25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Fix iOS bug which would break size of views when video is displayed with controls on a non full-screen React view. [#1931](https://github.com/react-native-community/react-native-video/pull/1931)
- Fix video dimensions being undefined when playing HLS in ios. [#1992](https://github.com/react-native-community/react-native-video/pull/1992)
- Add support for audio mix with other apps for iOS. [#1978](https://github.com/react-native-community/react-native-video/pull/1978)
- Properly implement pending seek for iOS. [#1993](https://github.com/react-native-community/react-native-video/pull/1993)

### Version 5.1.0-alpha5

Expand Down
6 changes: 5 additions & 1 deletion ios/Video/RCTVideo.m
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,11 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
height = [NSNumber numberWithFloat:_playerItem.presentationSize.height];
orientation = _playerItem.presentationSize.width > _playerItem.presentationSize.height ? @"landscape" : @"portrait";
}

if (_pendingSeek) {
[self setCurrentTime:_pendingSeekTime];
_pendingSeek = false;
}

if (self.onVideoLoad && _videoLoadStarted) {
self.onVideoLoad(@{@"duration": [NSNumber numberWithFloat:duration],
Expand Down Expand Up @@ -962,7 +967,6 @@ - (void)setSeek:(NSDictionary *)info
}

} else {
// TODO: See if this makes sense and if so, actually implement it
_pendingSeek = true;
_pendingSeekTime = [seekTime floatValue];
}
Expand Down

0 comments on commit 213bb25

Please sign in to comment.