Vasu
Vasu

Reputation: 4982

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.

Upvotes: 3

Views: 7055

Answers (1)

Raju Jadhav
Raju Jadhav

Reputation: 57

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");

Upvotes: 1

Related Questions