java - Youtube video does not play in webview -
i have tried youtube video not loading in webview instead if click on video share , action bar displayed
below source code
mwebview.setwebviewclient(new mywebviewclient()); mwebview.loadurl(sabnzburl); mwebview.getsettings().setdomstorageenabled(true); mwebview.getsettings().setjavascriptenabled(true); mwebview.getsettings().setbuiltinzoomcontrols(true); mwebview.getsettings().setsupportzoom(true); }
class mywebviewclient extends webviewclient { @override // show in webview instead of browser public boolean shouldoverrideurlloading(webview view, string url) { view.loadurl(url); webview engine = new webview(youtubeactivity.this); engine.getsettings().setjavascriptenabled(true); engine.getsettings().setpluginsenabled(true); log.i("youtubeactivity", "mywebviewclient: shouldoverrideurlloading"); string temp = "<object " + "width='220' height='200'" + ">" + "<param name='allowfullscreen' value='false'>" + "</param><param name='allowscriptaccess' value='always'>" + "</param><embed src='" + url + "'" + " type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true'" + "width='220' height='200'" + "></embed></object>"; engine.getsettings().setjavascriptenabled(true); engine.getsettings().setpluginsenabled(true); engine.loaddata(temp, "text/html", "utf-8"); return true; } androidmanifiest.xml
<activity android:name=".youtube.youtubeactivity" android:screenorientation="portrait" android:hardwareaccelerated="true"> the screen shot below


when click on youtube video actionbar come , share button video not load
Comments
Post a Comment