我在播放来自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])
}
答案 0 :(得分: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中属性应该是“playinline”而不是“playInline”愚蠢的我....它现在工作正常thx为每个人帮助