Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tips:cordova [2015/02/13 15:54] – scipio | tips:cordova [2015/02/19 17:10] (current) – [Cordova] scipio | ||
---|---|---|---|
Line 94: | Line 94: | ||
cd platforms/ | cd platforms/ | ||
android update project --subprojects --path . --target " | android update project --subprojects --path . --target " | ||
- | ant debug | + | ant clean debug |
cd .. # platforms/ | cd .. # platforms/ | ||
Line 144: | Line 144: | ||
===== Video autoplay ===== | ===== Video autoplay ===== | ||
+ | |||
+ | Con ionic-crosswalk i video partono da soli con il set di src via javascript | ||
+ | <code javascript> | ||
+ | if (! $('# | ||
+ | $('# | ||
+ | } | ||
+ | $("# | ||
+ | $("# | ||
+ | </ | ||
+ | |||
+ | ==== Cordova ==== | ||
CordovaApp.java | CordovaApp.java | ||
Line 149: | Line 160: | ||
super.init(); | super.init(); | ||
super.appView.getSettings().setMediaPlaybackRequiresUserGesture(false); | super.appView.getSettings().setMediaPlaybackRequiresUserGesture(false); | ||
+ | </ | ||
+ | |||
+ | ==== Cordova Crosswalk ==== | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | super.init(); | ||
+ | getSettings(super.appView).setMediaPlaybackRequiresUserGesture(false); | ||
+ | ... | ||
+ | |||
+ | /* rende plubblica la API mascherata dalle nuove release di crosswalk */ | ||
+ | private XWalkSettings getSettings(XWalkView webView) | ||
+ | { | ||
+ | try | ||
+ | { | ||
+ | Method ___getBridge = XWalkView.class.getDeclaredMethod(" | ||
+ | ___getBridge.setAccessible(true); | ||
+ | XWalkViewBridge xWalkViewBridge = null; | ||
+ | xWalkViewBridge = (XWalkViewBridge)___getBridge.invoke(webView); | ||
+ | XWalkSettings xWalkSettings = xWalkViewBridge.getSettings(); | ||
+ | return xWalkSettings; | ||
+ | } | ||
+ | catch (Exception e) | ||
+ | { | ||
+ | e.printStackTrace(); | ||
+ | } | ||
+ | return null; | ||
+ | } | ||
</ | </ | ||