Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Fix random crash on iOS when switching source (#1899)
Browse files Browse the repository at this point in the history
  • Loading branch information
mphill committed Aug 24, 2022
1 parent 14c7ab4 commit f3a4251
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,15 @@ TimeSpan Position
{
get
{
if (avPlayerViewController?.Player?.CurrentTime.IsInvalid ?? true)
if (avPlayerViewController.Player?.CurrentItem == null)
return TimeSpan.Zero;

return TimeSpan.FromSeconds(avPlayerViewController.Player.CurrentTime.Seconds);
var currentTime = avPlayerViewController.Player.CurrentTime;

if (double.IsNaN(currentTime.Seconds) || currentTime.IsIndefinite)
return TimeSpan.Zero;

return TimeSpan.FromSeconds(currentTime.Seconds);
}
}

Expand Down

0 comments on commit f3a4251

Please sign in to comment.