Skip to content

Commit

Permalink
Remove video layer when entering background correctly, both if using …
Browse files Browse the repository at this point in the history
…controls or not
  • Loading branch information
jenshandersson committed Jun 10, 2019
1 parent c30f246 commit 51598a5
Showing 1 changed file with 2 additions and 0 deletions.
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 51598a5

Please sign in to comment.