Android: how to play YouTube video on the emulator

Can anyone help me in

1. Is it possible to play YouTube videos on the emulator using the YouTube video link (for example: http://www.youtube.com/watch?v=T1Wgp3mLa_E )? If not, why? 2. If yes, how?

I tried to play the video on YouTube using VideoView but got

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

+3
source share
1 answer

Video does not play on the emulator.

but it is possible on the 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");
+1
source

Source: https://habr.com/ru/post/1739098/


All Articles