Show pageOld revisionsBacklinksAdd to bookExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== inAppBrowser ====== ===== backbutton ===== With these modifications the hardware back button works within pages in an InAppBrowser. In src/com/org/apache/corodova/inappbrowser/**InAppBrowser.java** change <code java> private void goBack() { if (this.inAppWebView.canGoBack()) { this.inAppWebView.goBack(); } } </code> to (public method) <code java> public void goBack() { if (this.inAppWebView.canGoBack()) { this.inAppWebView.goBack(); } } public boolean canGoBack() { return this.inAppWebView.canGoBack(); } </code> src/com/org/apache/corodova/inappbrowser/**InAppBrowserDialog.java** change <code java> public void onBackPressed () { if (this.inAppBrowser == null) { this.dismiss(); } else { // better to go through the in inAppBrowser // because it does a clean up this.inAppBrowser.closeDialog(); } } </code> to <code java> public void onBackPressed () { if (this.inAppBrowser == null) { this.dismiss(); } else { if (this.inAppBrowser.canGoBack()) { this.inAppBrowser.goBack(); } else { this.inAppBrowser.closeDialog(); } } } </code> ===== autoplay ===== Enable video autplay without gestures In file src/com/org/apache/corodova/inappbrowser/**InAppBrowser.java** add (~647 row) <code java> inAppWebView.loadUrl(url); inAppWebView.setId(6); inAppWebView.getSettings().setLoadWithOverviewMode(true); inAppWebView.getSettings().setUseWideViewPort(true); + inAppWebView.getSettings().setMediaPlaybackRequiresUserGesture(false); </code> ===== loop ===== Looping mode does not work, add this hack to javascript and add looping="loop" attribute to video tag <code javascript> var videos = jQNew( "video[looping='loop']" ); for (index = 0; index < videos.length; ++index) { videos[index].addEventListener('ended', function (e) {window.location.reload();},false); } </code> tips/cordova/inappbrowser.txt Last modified: 2015/03/27 17:40by scipio