Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android: How to play YouTube video on emulator

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.

like image 382
Vasu Avatar asked Dec 31 '25 04:12

Vasu


1 Answers

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");
like image 69
Raju Jadhav Avatar answered Jan 02 '26 18:01

Raju Jadhav