【问题标题】:getting error "There was a issue with network [400]" while playing You tube video播放 You Tube 视频时出现错误“网络 [400] 出现问题”
【发布时间】:2017-01-25 05:16:52
【问题描述】:

我正在使用 Android You Tube API 播放你的 Tube 视频。某些 URL 工作正常,但在某些 URL 中,我在屏幕上发现错误消息说“网络出现问题 [400] 点击重试”。互联网已连接。请帮帮我。提前致谢。

【问题讨论】:

  • 表示您的网址不正确。这是错误的请求错误。
  • 没有。我在窗口浏览器上检查了 URL。它正在工作。
  • 有代码吗?
  • Intent intent = YouTubeStandalonePlayer.createVideoIntent(this, Config.DEVELOPER_KEY, videoId, 0, true, false); if (intent != null) { if (canResolveIntent(intent)) { startActivityForResult(intent, REQ_START_STANDALONE_PLAYER); }
  • 任何人都可以帮助我,因为它非常紧急。

标签: android youtube-api android-youtube-api


【解决方案1】:

这个link,你的解决方案。

我认为仅将 YouTube ID 而非整个 YouTube 网址提供给 loadVideo() 函数。

更新:

如果您想跳转到视频中的特定时间。

API提供了两种跳转播放方式:

seekToMillis() – 寻找视频中的指定时间。

seekRelativeMillis() – 按指定的秒数向前或向后搜索。

更多信息here

【讨论】:

    【解决方案2】:

    只需从 url 中删除 **https://www.youtube.com/watch?v=**gNRN7lUU3tM 并仅将 gNRN7lUU3tM 作为 url 提供给 youtube 播放器。它会正常工作

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-30
      相关资源
      最近更新 更多