this will work for U:
func updateControlsvisibility(view: UIView?){
guard let view = view else {
return
}
if view.isKind(of: NSClassFromString("AVButton") ?? NSNull.self){
view.alpha = 1.0
view.isHidden = false
var parent = view.superview
while let p = parent{
p.alpha = 1.0
p.isHidden = false
parent = p.superview
}
return
}
for subview in view.subviews{
if subview != view {
self.updateControlsvisibility(view: subview)
}
}
}
//when the AVPlayerViewController is ready to display call this function
playerViewController.observe(\.isReadyForDisplay) { [weak self] observed, _ in
if observed.isReadyForDisplay, greateThaniOS16 {
self?.updateControlsvisibility(view: playerViewController.view)
}
}
Post
Replies
Boosts
Views
Activity
try this kludge:
func updateControlsvisibility(view: UIView?){
guard let view = view else {
return
}
if view.isKind(of: NSClassFromString("AVButton") ?? NSNull.self){
view.alpha = 1.0
view.isHidden = false
var parent = view.superview
while let p = parent{
p.alpha = 1.0
p.isHidden = false
parent = p.superview
}
return
}
for subview in view.subviews{
if subview != view {
self.updateControlsvisibility(view: subview)
}
}
}
//when the AVPlayerViewController is ready to display call this function
playerViewController.observe(\.isReadyForDisplay) { [weak self] observed, _ in
if observed.isReadyForDisplay {
self?.updateControlsvisibility(view: playerViewController.view)
}
}