diff --git a/RCTVideo.m b/RCTVideo.m
index 47aa2707..e7e288a5 100644
--- a/RCTVideo.m
+++ b/RCTVideo.m
@@ -54,11 +54,37 @@ static NSString *const statusKeyPath = @"status";
_pendingSeek = false;
_pendingSeekTime = 0.0f;
_lastSeekTime = 0.0f;
+
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(applicationWillResignActive:)
+ name:UIApplicationWillResignActiveNotification
+ object:nil];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(applicationWillEnterForeground:)
+ name:UIApplicationWillEnterForegroundNotification
+ object:nil];
}
return self;
}
+#pragma mark - App lifecycle handlers
+
+- (void)applicationWillResignActive:(NSNotification *)notification
+{
+ if (!_paused) {
+ [self stopProgressTimer];
+ [_player pause];
+ }
+}
+
+- (void)applicationWillEnterForeground:(NSNotification *)notification
+{
+ [self startProgressTimer];
+ [self applyModifiers];
+}
+
#pragma mark - Progress
- (void)sendProgressUpdate
diff --git a/package.json b/package.json
index b4c2f52f..679d0c4d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "react-native-video",
- "version": "0.4.7",
+ "version": "0.4.8",
"description": "A element for react-native",
"main": "Video.ios.js",
"author": "Brent Vatne (https://github.com/brentvatne)",