Full screen problem, can refer to http://bbs.csdn.net/topics/390839259, click
WebView = (WebView) Findviewbyid (r.id.webview); videoview = (framelayout) Findviewbyid (r.id.video_view); chromeclient = New Webchromeclient () {//@overridepublic void Onshowcustomview (view view, Customviewcallback callback) when playing a network video full screen will be called {if (islandport) {return;} Setrequestedorientation (Activityinfo.screen_orientation_landscape);//if (mycallback! = null) {// Mycallback.oncustomviewhidden ();//Mycallback = null;//return;//}webview.setvisibility (View.GONE); if (MyView! = null {Callback.oncustomviewhidden (); return;} Videoview.addview (view); MyView = View;mycallback = Callback;videoview.setvisibility (view.visible);} Private View MyView = null;private customviewcallback mycallback = null;public void Onhidecustomview () {if (MyView = = NULL ) {return;} else {//if (mycallback! = null) {//Mycallback.oncustomviewhidden ();//Mycallback = null;//}setrequestedorientation (Act ivityinfo.screen_orientation_portrait); myview.setvisibility (View.gone); Videoview.removeview (MyView); Videoview.setvisibility (VIew. GONE); webview.setvisibility (view.visible); Mycallback.oncustomviewhidden (); myView = null;}} @Overridepublic void Onreceivedtitle (WebView view, String title) {//TODO auto-generated method Stubsuper.onreceivedtitle (view, title), if (showtitle) {settitle (title);}}; WebSettings setting = Webview.getsettings (); Setting.setbuiltinzoomcontrols (false); Setting.setusewideviewport (True ); Setting.setloadwithoverviewmode (true); Setting.setcachemode (Websettings.load_no_cache); setting.setPluginState (pluginstate.on_demand);//Setting.setlayoutalgorithm (Layoutalgorithm.single_column); Supports content re-layout setting.setjavascriptenabled (true); setting.setjavascriptcanopenwindowsautomatically (true);
Note rotate the screen
Android:configchanges= "Orientation|keyboardhidden|screensize"
/** * This method is called when the screen switch is on or off * * @author * * @Overridepublic void onconfigurationchanged (Configuration newconfig) { Super.onconfigurationchanged (Newconfig); if (newconfig.orientation = = Configuration.orientation_landscape) { Islandport = true;} else if (newconfig.orientation = = configuration.orientation_portrait) {Islandport = false;}}
and turn off the sound, now can refer to here http://blog.csdn.net/cuizm/article/details/42342505
Add a cookie http://blog.csdn.net/encienqi/article/details/7912733
Cookies are not recommended, it is really difficult to use, browser caching is a headache problem
Android WebView Turn off sound when exiting 4. Video Full Screen Add cookie