3

Could someone help me in

1.Is this possible to play video from YouTube on emulator using YouTube video link (like:http://www.youtube.com/watch?v=T1Wgp3mLa_E) ? If not, then why? 2.If yes then how ?

I tried to play YouTube video using VideoView but got

"Command PLAYER_INIT completed with an error or info PVMFErrCorrupt" message through logcat command.

Andro Selva
  • 53,910
  • 52
  • 193
  • 240
Vasu
  • 4,862
  • 8
  • 42
  • 48
  • I'm putting my answer here, because I don't really know, but it's probably something like startActivity(new Intent(Intent.ACTION_VIEW).setData("http://www.youtube.com/watch?v=T1Wgp3mLa_E")); – synic Mar 30 '10 at 06:47
  • You tried playing a YouTube video in a `VideoView`? That doesn't sound like it would work at all, emulator or real device. If you're simply trying to show a YouTube video full screen in your app, use `ACTION_VIEW` on the youtube.com URL. The user will need the YouTube app installed for it to work. – Roman Nurik Mar 30 '10 at 08:17
  • Actually I want to make my own YouTube app to play YouTube Video. – Vasu Mar 30 '10 at 08:47
  • whatever you used YouTube will provide the mobile version site for all Videos. it will automatically redirect to the phone's default player. Dont worry to do that. one my friend had done it on Iphone. i didnt checked it in android. hope it works. – Praveen Mar 30 '10 at 09:20

1 Answers1

1

Video not play on emulator.

but it might be possible on device try this..

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");
Vivek Kalkur
  • 2,200
  • 2
  • 21
  • 40
Raju Jadhav
  • 57
  • 1
  • 6