我在我的应用程序中使用AVPictureInPictureController的画中画功能,想要隐藏AVPictureInPictureController中的播放/暂停按钮,但我尝试失败了。现在我需要帮助。
试试这个:
if #available(iOS 14.0, *) {
//Hide the seekbar
pipController?.requiresLinearPlayback = true
} else {
// Fallback on earlier versions
}
//Hide the play/pause controls
pipController?.setValue(1, forKey: "controlsStyle")
AVPictureInPictureController
,因此始终显示播放/暂停按钮是有意义的。我认为没有隐藏它们的方法,因为甚至不支持子类化。来源:https://developer.apple.com/documentation/avkit/avpictureinpicturecontroller - Spyros P.