Skip to content

Commit

Permalink
Detach player for play audio in background and fix 2nd play on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
orzech85 committed Jul 22, 2019
1 parent 1f83aa1 commit 21e9a51
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions MediaManager/Platforms/Ios/Video/PlayerViewController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using AVKit;

namespace MediaManager.Platforms.Ios.Video
{
public class PlayerViewController : AVPlayerViewController
{
public override void ViewWillDisappear(bool animated)
{
base.ViewWillDisappear(animated);

Player = null;
}
}
}
2 changes: 1 addition & 1 deletion MediaManager/Platforms/Ios/Video/VideoView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public AVPlayerViewController PlayerViewController
{
if(_playerViewController == null)
{
PlayerViewController = new AVPlayerViewController();
PlayerViewController = new PlayerViewController();
}
return _playerViewController;
}
Expand Down

0 comments on commit 21e9a51

Please sign in to comment.