Skip to content

Commit

Permalink
fix: duration is NaN or infinite
Browse files Browse the repository at this point in the history
  • Loading branch information
godly-devotion committed Mar 27, 2024
1 parent eebc149 commit 5028f9a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Front Row/Support/PlayEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ import SwiftUI
) { [weak self] time in
guard let self else { return }
_currentTime = time.seconds
duration = player.currentItem?.duration.seconds ?? 0.0

guard let seconds = player.currentItem?.duration.seconds else { return }
guard !seconds.isNaN && !seconds.isInfinite else { return }
duration = seconds
}
}

Expand Down

0 comments on commit 5028f9a

Please sign in to comment.