我发现我可以通过这种方式在 YouTube 播放器中播放 YouTube 视频:
Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:U79wVTdnMpw"));
startActivity(i);
但它不起作用。 YouTube 播放器已启动,但出现错误:
There was a problem with the network [400]
我已经更新了 YouTube 应用,但没有任何变化。
我使用的是 Android ICS 4.0.1。
最佳答案
我在这个 Google product forums 上找到了答案这有助于解决我的问题 - 这正是您遇到的问题:)
解决方案:仅向 loadVideo()
函数提供 YouTube ID 而不是整个 YouTube URL。
关于android - YouTube Intent ,错误 400,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13731192/