Skip to content

Commit

Permalink
Merge pull request TheWidlarzGroup#1614 from jenshandersson/master
Browse files Browse the repository at this point in the history
Remove video player when entering background correctly
  • Loading branch information
CHaNGeTe authored Jun 19, 2019
2 parents a3b32ac + 0a15579 commit 92f7459
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### next
* Replaced RCTBubblingEventBlock events by RCTDirectEventBlock to avoid event name collisions [#1625](https://github.com/react-native-community/react-native-video/pull/1625)
* Added `onPlaybackRateChange` to README [#1578](https://github.com/react-native-community/react-native-video/pull/1578)
* Fix background audio stopping on iOS when using `controls` [#1614](https://github.com/react-native-community/react-native-video/pull/1614)

### Version 4.4.1
* Fix tvOS picture-in-picture compilation regression [#1518](https://github.com/react-native-community/react-native-video/pull/1518)
Expand Down
2 changes: 2 additions & 0 deletions ios/Video/RCTVideo.m
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ - (void)applicationDidEnterBackground:(NSNotification *)notification
if (_playInBackground) {
// Needed to play sound in background. See https://developer.apple.com/library/ios/qa/qa1668/_index.html
[_playerLayer setPlayer:nil];
[_playerViewController setPlayer:nil];
}
}

Expand All @@ -231,6 +232,7 @@ - (void)applicationWillEnterForeground:(NSNotification *)notification
[self applyModifiers];
if (_playInBackground) {
[_playerLayer setPlayer:_player];
[_playerViewController setPlayer:_player];
}
}

Expand Down

0 comments on commit 92f7459

Please sign in to comment.