Commit f83da614 authored by Baris Sencan's avatar Baris Sencan
Browse files

Seek to time on main thread

parent 449b97a6
Loading
Loading
Loading
Loading
+2 −0
Changes for RCTVideo.m: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -321,6 +321,7 @@ static NSString *const statusKeyPath = @"status";
    CMTime tolerance = CMTimeMake(1000, timeScale);

    if (CMTimeCompare(current, cmSeekTime) != 0) {
      dispatch_async(dispatch_get_main_queue(), ^{
        [_player seekToTime:cmSeekTime toleranceBefore:tolerance toleranceAfter:tolerance completionHandler:^(BOOL finished) {
          [_eventDispatcher sendInputEventWithName:RNVideoEventSeek body:@{
            @"currentTime": [NSNumber numberWithFloat:CMTimeGetSeconds(item.currentTime)],
@@ -328,6 +329,7 @@ static NSString *const statusKeyPath = @"status";
            @"target": self.reactTag
          }];
        }];
      });

      _pendingSeek = false;
    }