Skip to content

Commit

Permalink
Fix autoplay & playing after buffering
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-dziennik-miquido committed Sep 13, 2023
1 parent 300794d commit 8a15097
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ios/Video/RCTVideo.m
Original file line number Diff line number Diff line change
Expand Up @@ -2210,6 +2210,7 @@ - (void)setSeekManaged:(NSDictionary*) info {
CMTime tolerance = CMTimeMake([seekTolerance floatValue], timeScale);

if (CMTimeCompare(current, cmSeekTime) != 0) {
BOOL wasPaused = _paused;
[_player pause];
[slavePlayer pause];

Expand All @@ -2228,7 +2229,7 @@ - (void)setSeekManaged:(NSDictionary*) info {
[self seekCompletedForSeekTime:seekTime];
[slave seekCompletedForSeekTime:seekTime];
dispatch_after(DISPATCH_TIME_NOW + 1 * NSEC_PER_SEC, dispatch_get_main_queue(), ^{
[self setManagedPaused:NO];
[self setManagedPaused:wasPaused];
});
});
_pendingSeek = false;
Expand Down Expand Up @@ -2262,6 +2263,9 @@ - (void)updateState:(VideoState) newState {
if ([self isSlave]) {
RCTVideo *master = [self master];
[master onSlaveVideoStatusChange];
} else if ([self isVideoReady] && [[self slave] isVideoReady]) {
[self setPaused:NO];
_masterPendingPlayRequest = NO;
}
}

Expand Down

0 comments on commit 8a15097

Please sign in to comment.