From d09989cec26a5e1fe19ddd52f97296cfe1dfb05a Mon Sep 17 00:00:00 2001 From: Ibrahim Sulejmenov Date: Sat, 15 Mar 2025 14:37:23 +0100 Subject: [PATCH] added skip 85 seconds button: fix for ipads --- .../CustomPlayer/CustomPlayer.swift | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Sora/Utils/MediaPlayer/CustomPlayer/CustomPlayer.swift b/Sora/Utils/MediaPlayer/CustomPlayer/CustomPlayer.swift index 67d434f..b783d4d 100644 --- a/Sora/Utils/MediaPlayer/CustomPlayer/CustomPlayer.swift +++ b/Sora/Utils/MediaPlayer/CustomPlayer/CustomPlayer.swift @@ -410,13 +410,23 @@ class CustomMediaPlayerViewController: UIViewController { controlsContainerView.addSubview(skip85Button) skip85Button.translatesAutoresizingMaskIntoConstraints = false - NSLayoutConstraint.activate([ - skip85Button.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 85), - skip85Button.bottomAnchor.constraint(equalTo: watchNextButton.bottomAnchor), - skip85Button.heightAnchor.constraint(equalTo: watchNextButton.heightAnchor), - skip85Button.widthAnchor.constraint(equalTo: watchNextButton.widthAnchor) - ]) + if UIDevice.current.userInterfaceIdiom == .pad { + NSLayoutConstraint.activate([ + skip85Button.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 30), + skip85Button.bottomAnchor.constraint(equalTo: watchNextButton.bottomAnchor), + skip85Button.heightAnchor.constraint(equalTo: watchNextButton.heightAnchor), + skip85Button.widthAnchor.constraint(equalTo: watchNextButton.widthAnchor) + ]) + } else { + NSLayoutConstraint.activate([ + skip85Button.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 25), + skip85Button.bottomAnchor.constraint(equalTo: watchNextButton.bottomAnchor), + skip85Button.heightAnchor.constraint(equalTo: watchNextButton.heightAnchor), + skip85Button.widthAnchor.constraint(equalTo: watchNextButton.widthAnchor) + ]) + } } + func updateSubtitleLabelAppearance() { subtitleLabel.font = UIFont.systemFont(ofSize: CGFloat(subtitleFontSize))