diff --git a/ios/ReactNativeVideoPlayerView.mm b/ios/ReactNativeVideoPlayerView.mm index 17bc263..73ed6f1 100644 --- a/ios/ReactNativeVideoPlayerView.mm +++ b/ios/ReactNativeVideoPlayerView.mm @@ -70,6 +70,10 @@ - (void)initCommon:(UIView *)view selector:@selector(playerItemDidPlayToEndTime:) name:AVPlayerItemDidPlayToEndTimeNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(restorePlay:) + name:UIApplicationDidBecomeActiveNotification + object:nil]; }); } @@ -125,6 +129,13 @@ - (void)prepareForRecycle #endif } +- (void)restorePlay:(NSNotification *)notification +{ + if (!_paused) { + [_player play]; + } +} + - (void)_release { [[NSNotificationCenter defaultCenter] removeObserver:self];