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开发者_如何学Python=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.
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");
精彩评论