From fa0784e5d98e4f879eab11f9f201662b80f78407 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Mon, 11 Jul 2022 18:43:23 +0200 Subject: [PATCH] Fix details overlay height --- Shared/Player/Controls/PlayerControls.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Shared/Player/Controls/PlayerControls.swift b/Shared/Player/Controls/PlayerControls.swift index 7f99fce0..7e1e7e82 100644 --- a/Shared/Player/Controls/PlayerControls.swift +++ b/Shared/Player/Controls/PlayerControls.swift @@ -102,7 +102,7 @@ struct PlayerControls: View { .opacity(model.presentingControlsOverlay ? 1 : 0) VideoDetailsOverlay() - .frame(maxWidth: detailsWidth, maxHeight: 450) + .frame(maxWidth: detailsWidth, maxHeight: detailsHeight) .modifier(ControlBackgroundModifier()) .clipShape(RoundedRectangle(cornerRadius: 4)) .opacity(model.presentingDetailsOverlay ? 1 : 0) @@ -140,6 +140,11 @@ struct PlayerControls: View { return [player.playerSize.width, 600].min()! } + var detailsHeight: Double { + guard let player = player, player.playerSize.height.isFinite else { return 200 } + return [player.playerSize.height, 500].min()! + } + @ViewBuilder var controlsBackground: some View { if player.musicMode, let item = self.player.currentItem,