Skip to content

Commit

Permalink
Merge pull request #540 from orzech85/detach_player
Browse files Browse the repository at this point in the history
Detach player for play audio in background and fix 2nd play on iOS
  • Loading branch information
martijn00 authored Jul 23, 2019
2 parents 1f83aa1 + 21e9a51 commit 45e8727
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 45e8727

Please sign in to comment.