Fix crashes (#69, #71)

This commit is contained in:
Arkadiusz Fal 2022-03-31 20:39:02 +02:00
parent 1490437537
commit e39f4373bb

View File

@ -103,7 +103,11 @@ struct PlaybackBar: View {
return "loading..." return "loading..."
} }
let videoLengthAtRate = player.currentVideo!.length / Double(player.currentRate) guard let video = player.currentVideo else {
return ""
}
let videoLengthAtRate = video.length / Double(player.currentRate)
let remainingSeconds = videoLengthAtRate - player.time!.seconds let remainingSeconds = videoLengthAtRate - player.time!.seconds
if remainingSeconds < 60 { if remainingSeconds < 60 {