【问题标题】:YTPlayerView doesn't play video when you click单击时 YTPlayerView 不播放视频
【发布时间】:2016-03-18 14:08:28
【问题描述】:

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

playerView.loadWithVideoId("someId")

【问题讨论】:

    标签: ios swift youtube youtube-api ytplayerview


    【解决方案1】:

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

    更新您的 Podfile 以指向 repo 头并更新 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: [:])
    

    【讨论】:

      猜你喜欢
      • 2014-11-10
      • 2017-07-08
      • 2015-11-13
      • 2018-04-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-13
      • 1970-01-01
      相关资源
      最近更新 更多