Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
601 views
in Technique[技术] by (71.8m points)

ios - Display custom controls in AVPlayerViewController when full screen

I use AVPlayerViewController to display inline videos in my app. The thing is I would like to have custom controls when the AVPlayerViewController goes full screen but not when it is inline.

I'm trying to do this through this delegate method

func playerViewController(_ playerViewController: AVPlayerViewController, willBeginFullScreenPresentationWithAnimationCoordinator coordinator: UIViewControllerTransitionCoordinator) {
    
    playerViewController.showsPlaybackControls = false
    addCustomControlsToPlayerViewController()
}

However this is not working cause, even though system controls are hidden, the view containing these controls "AVPlaybackControlsView" is not. And this view is on top of everything else in the ACPlayerViewController.

Is there a way to have system controls when AVPlayerViewController is inline, but custom controls when AVPlayerViewController is full screen?

question from:https://stackoverflow.com/questions/65644976/display-custom-controls-in-avplayerviewcontroller-when-full-screen

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...