Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove video player when entering background correctly #1614

Merged
merged 2 commits into from
Jun 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### next
* 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