From f29dc792c2b8d180e6a398d367600e46395120d8 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Thu, 6 Jan 2022 17:47:07 +0100 Subject: [PATCH] Fix player controls progress bar warning --- Model/Player/PlayerModel.swift | 2 +- Shared/Views/PlayerControlsView.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Model/Player/PlayerModel.swift b/Model/Player/PlayerModel.swift index d03d9ca7..1fe3923e 100644 --- a/Model/Player/PlayerModel.swift +++ b/Model/Player/PlayerModel.swift @@ -159,7 +159,7 @@ final class PlayerModel: ObservableObject { } var videoDuration: TimeInterval? { - currentItem?.duration ?? currentVideo?.length + currentItem?.duration ?? currentVideo?.length ?? player.currentItem?.asset.duration.seconds } func togglePlay() { diff --git a/Shared/Views/PlayerControlsView.swift b/Shared/Views/PlayerControlsView.swift index 1b7ec644..b006bac1 100644 --- a/Shared/Views/PlayerControlsView.swift +++ b/Shared/Views/PlayerControlsView.swift @@ -132,7 +132,7 @@ struct PlayerControlsView: View { } private var progressViewTotal: Double { - model.playerItemDuration?.seconds ?? model.currentVideo?.length ?? 100 + model.videoDuration ?? 100 } }