diff --git a/Model/Player/PlayerControlsModel.swift b/Model/Player/PlayerControlsModel.swift index 27147ff4..cd4dde07 100644 --- a/Model/Player/PlayerControlsModel.swift +++ b/Model/Player/PlayerControlsModel.swift @@ -106,7 +106,7 @@ final class PlayerControlsModel: ObservableObject { removeTimer() - guard !player.musicMode else { + guard let player = player, !player.musicMode else { return } diff --git a/Shared/Player/Controls/PlayerControls.swift b/Shared/Player/Controls/PlayerControls.swift index 5c6511a6..8bcaa318 100644 --- a/Shared/Player/Controls/PlayerControls.swift +++ b/Shared/Player/Controls/PlayerControls.swift @@ -34,6 +34,7 @@ struct PlayerControls: View { Group { HStack { statusBar + .lineLimit(1) .padding(3) #if os(macOS) .background(VisualEffectBlur(material: .hudWindow)) @@ -415,20 +416,12 @@ struct PlayerControls_Previews: PreviewProvider { model.currentTime = .secondsInDefaultTimescale(0) model.duration = .secondsInDefaultTimescale(120) - let view = ZStack { + return ZStack { Color.gray PlayerControls(player: PlayerModel(), thumbnails: ThumbnailsModel()) .injectFixtureEnvironmentObjects() .environmentObject(model) } - - return Group { - if #available(iOS 15.0, macOS 12.0, tvOS 15.0, *) { - view.previewInterfaceOrientation(.landscapeLeft) - } else { - view - } - } } }