in Android Code Tips

How to play/embed YouTube videos in WebView

How to play/embed YouTube videos in WebView

mWebView.getSettings().setPluginState(PluginState.ON);
mWebView.getSettings().setJavaScriptEnabled(true); 

and make sure you have the “embed code” in your html code.
(You will need to change the size of the video though, the default size is huge for a mobile screen!)

Share