Implement pending seek

This commit is contained in:
Jens Andersson
2020-05-07 10:58:20 +02:00
parent 838b99aacb
commit 6bc25f1099
2 changed files with 6 additions and 1 deletions

View File

@@ -645,6 +645,11 @@ static int const RCTVideoUnset = -1;
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],
@@ -962,7 +967,6 @@ static int const RCTVideoUnset = -1;
}
} else {
// TODO: See if this makes sense and if so, actually implement it
_pendingSeek = true;
_pendingSeekTime = [seekTime floatValue];
}