0

在此处输入图像描述

如您所见,我想在画中画上隐藏这三个按钮,有什么解决办法吗?

这是我的点子代码:

private lazy var playerLayer: AVPlayerLayer = {
    let layer = AVPlayerLayer()
    
    let mp4Video = Bundle.main.url(forResource: "v1", withExtension: "MP4")
    let asset = AVAsset.init(url: mp4Video!)
    let playerItem = AVPlayerItem.init(asset: asset)
    
    let player = AVPlayer.init(playerItem: playerItem)
    layer.player = player
    player.isMuted = true
    player.allowsExternalPlayback = false
    
    
    return layer
}()

private lazy var pipVC: AVPictureInPictureController = {
    let vc = AVPictureInPictureController.init(playerLayer: playerLayer)
    vc?.delegate = self
    return vc!
}()
4

1 回答 1

0

您至少可以通过以下方式隐藏搜索按钮:

vc.requiresLinearPlayback = true

其中vc是您的AVPictureInPictureController实例。

如果您已经找到了隐藏播放按钮的方法,请分享。

于 2021-09-25T13:29:48.953 回答