Skip to content

Commit

Permalink
Merge pull request #890 from gsgou/issue_888
Browse files Browse the repository at this point in the history
fixes issue #888, removing already removed observer causes app termination due to NSInvalidArgumentException
  • Loading branch information
martijn00 authored Mar 4, 2023
2 parents 4f98e73 + c54ba0b commit 7f72e5b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MediaManager/Platforms/Ios/Player/AppleMediaPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ protected virtual async void OnPlayerBoundaryReached()
{
await Pause();
Player.RemoveTimeObserver(playbackTimeObserver);
playbackTimeObserver = null;
}

public virtual async Task Play(AVPlayerItem playerItem)
Expand Down Expand Up @@ -276,7 +277,10 @@ protected override void Dispose(bool disposing)
});

if (playbackTimeObserver != null)
{
Player.RemoveTimeObserver(playbackTimeObserver);
playbackTimeObserver = null;
}

rateToken?.Dispose();
statusToken?.Dispose();
Expand Down

0 comments on commit 7f72e5b

Please sign in to comment.