Merge pull request #1614 from jenshandersson/master

Remove video player when entering background correctly
This commit is contained in:
Daniel Mariño Ruiz
2019-06-19 21:11:42 +02:00
committed by GitHub
2 changed files with 3 additions and 0 deletions

View File

@@ -223,6 +223,7 @@ static int const RCTVideoUnset = -1;
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];
}
}
@@ -231,6 +232,7 @@ static int const RCTVideoUnset = -1;
[self applyModifiers];
if (_playInBackground) {
[_playerLayer setPlayer:_player];
[_playerViewController setPlayer:_player];
}
}