单击时YTPlayerView不播放视频

时间:2015-12-12 19:53:58

标签: ios swift youtube youtube-api ytplayerview

我试图在我的Swift(2.x),iOS 9项目中使用YTPlayerView,但我只能用播放符号显示视频预览。单击符号时没有任何反应。

playerView.loadWithVideoId("someId")

1 个答案:

答案 0 :(得分:0)

这是YTPlayerView的某些先前版本的错误。

更新您的Podfile以指向repo head并更新pod:

pod 'youtube-ios-player-helper', :git=>'https://github.com/youtube/youtube-ios-player-helper', :commit=>'head'

然后尝试再次调用loadWithVideoId,或者使用空playerVars字典:

self.playerView.loadWithVideoId("U5vgRJ0zK6Y")

self.playerView.loadWithVideoId("U5vgRJ0zK6Y", playerVars: [:])