-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notch support #193
Comments
This is an old issue but for those who might see this later i maid the change in There is the code : override func layoutSubviews() {
let size = bounds.size
var topSafeAreaHeight: CGFloat = 0
var bottomSafeAreaHeight: CGFloat = 0
if #available(iOS 11.0, *) {
let window = UIApplication.shared.windows[0]
let safeFrame = window.safeAreaLayoutGuide.layoutFrame
topSafeAreaHeight = safeFrame.minY
bottomSafeAreaHeight = window.frame.maxY - safeFrame.maxY
}
previewImageView.frame = bounds
activityIndicatorView.sizeToFit()
activityIndicatorView.frame.origin = CGPoint(
x: (size.width - activityIndicatorView.frame.size.width) / 2,
y: (size.height - activityIndicatorView.frame.size.height) / 2)
topBar.sizeToFit()
topBar.frame = CGRect(
x: 0,
y: controlsHidden ? -topBar.frame.size.height : topSafeAreaHeight,
width: size.width,
height: topBar.frame.size.height)
topBar.alpha = controlsHidden ? 0 : 1
bottomBar.sizeToFit()
bottomBar.frame = CGRect(
x: 0,
y: size.height - (controlsHidden ? 0 : bottomBar.frame.size.height + bottomSafeAreaHeight),
width: size.width,
height: bottomBar.frame.size.height)
bottomBar.alpha = controlsHidden ? 0 : 1
overlayContainerView.frame = CGRect(
x: 0,
y: controlsHidden ? 0 : topBar.frame.size.height,
width: size.width,
height: size.height - (controlsHidden ? 0 : (topBar.frame.size.height + bottomBar.frame.size.height)))
for overlay in overlayContainerView.subviews {
overlay.frame = overlayContainerView.bounds
}
super.layoutSubviews()
}
} I will submit a pull request with that update. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey there, any plans to adjust this player to support the iPhone X notch?
The text was updated successfully, but these errors were encountered: