【问题标题】:android: How to play YouTube video on emulatorandroid:如何在模拟器上播放 YouTube 视频
【发布时间】:2010-03-30 06:32:33
【问题描述】:

谁能帮帮我

1.这是否可以使用 YouTube 视频链接(如:http://www.youtube.com/watch?v=T1Wgp3mLa_E)在模拟器上播放来自 YouTube 的视频?如果不是,那为什么? 2.如果是那怎么办?

我尝试使用 VideoView 播放 YouTube 视频,但得到了

"Command PLAYER_INIT completed with an error or info PVMFErrCorrupt" 通过 logcat 命令发送消息。

【问题讨论】:

  • 我把我的答案放在这里,因为我真的不知道,但它可能类似于 startActivity(new Intent(Intent.ACTION_VIEW).setData("youtube.com/watch?v=T1Wgp3mLa_E"));跨度>
  • 您尝试在VideoView 中播放 YouTube 视频?听起来它根本不起作用,模拟器或真实设备。如果您只是想在应用中全屏显示 YouTube 视频,请在 youtube.com 网址上使用 ACTION_VIEW。用户需要安装 YouTube 应用才能运行。
  • 其实我想制作自己的YouTube应用来播放YouTube视频。
  • 无论您使用什么,YouTube 都会为所有视频提供移动版网站。它会自动重定向到手机的默认播放器。不要担心这样做。我的一个朋友在 Iphone 上做过。我没有在android中检查它。希望它有效。

标签: android android-video-player


【解决方案1】:

视频无法在模拟器上播放。

但在设备上可能是可能的 试试这个。。

WebView webview = new WebView(this); 
String htmlString = "<html> <body> <embed src=\"youtube link\"; type=application/x-shockwave-flash width="+widthOfDevice+" height="+heightOfDevice+"> </embed> </body> </html>"; 
webview.loadData(htmlString ,"text/html", "UTF-8");

【讨论】:

  • 它在设备上也对我不起作用。设备是否需要 Flash 播放器或其他东西??
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-23
  • 1970-01-01
  • 2014-05-01
  • 2011-09-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多