gpt4 book ai didi

Swift Youtube API 内联模式不起作用

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

我在从 youtube api 播放视频时遇到问题,即使我设置了 allowsInlineMediaPlayback = true 它似乎仍然不起作用,我什至尝试使用内联参数初始化播放器,但它也不起作用。 ..

    override func viewDidLoad() {

self.playerView.delegate = self
playerView.webView?.allowsInlineMediaPlayback = true
playerView.webView?.allowsLinkPreview = true
//playerView.isHidden = true
//playerView.load(withVideoId: "60ItHLz5WEA")
playerView.load(withVideoId: "60ItHLz5WEA", playerVars: ["playsInline":1])

}

最佳答案

好的,我明白了,我拼错了;c 覆盖 func viewDidLoad() {

self.playerView.delegate = self
playerView.webView?.allowsInlineMediaPlayback = true
playerView.webView?.allowsLinkPreview = true
//playerView.isHidden = true
//playerView.load(withVideoId: "60ItHLz5WEA")
playerView.load(withVideoId: "60ItHLz5WEA", playerVars: ["playsInline":1])}

在 playerVars 中,属性应该是“playsinline”而不是“playsInline”,愚蠢的我....它现在工作正常,谢谢大家的帮助

关于Swift Youtube API 内联模式不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47502857/

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