gpt4 book ai didi

ios - Swift 隐藏 View AVPlayerViewController

转载 作者:行者123 更新时间:2023-11-28 20:50:20 25 4
gpt4 key购买 nike

我想知道如何隐藏 AVPlayer 的 View 。

guard let url = URL(string: "http://stream.radiomedia.com.au:8006/stream.m3u") else {
return
}
// Create a new AVPlayer and associate it with the player view
let player = AVPlayer(url: url)

// Create a new AVPlayerViewController and pass it a reference to the player.
let controller = AVPlayerViewController()
controller.player = player

// Modally present the player and call the player's play() method when complete.
present(controller, animated: true) {
player.play()
}

我想隐藏的是它显示的黑屏,因为这只是音频。没有视觉效果。

所以我想隐藏查看器而不一定是控件。

最佳答案

如果您不需要 UI,您可以在没有 AVPlayerViewController 的情况下使用 AVPlayer

关于ios - Swift 隐藏 View AVPlayerViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58972482/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com