Fix details overlay height

This commit is contained in:
Arkadiusz Fal 2022-07-11 18:43:23 +02:00
parent 0716602e3f
commit fa0784e5d9

View File

@ -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,