tips:cordova

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tips:cordova [2015/02/16 16:18] – [Video autoplay] scipiotips:cordova [2015/02/19 17:10] (current) – [Cordova] scipio
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 (! $('#video1')[0].src) {
 +  $('#video1')[0].src = "http://...";
 +  }
 +$("#video1")[0].currentTime = 0; // rewind
 +$("#video1")[0].play();
 +</code>
  
 ==== Cordova ==== ==== Cordova ====
Line 158: Line 167:
     ...     ...
     super.init();     super.init();
-    getSettings().setMediaPlaybackRequiresUserGesture(false);+    getSettings(super.appView).setMediaPlaybackRequiresUserGesture(false);
     ...     ...
  
Line 172: Line 181:
             XWalkSettings xWalkSettings = xWalkViewBridge.getSettings();             XWalkSettings xWalkSettings = xWalkViewBridge.getSettings();
             return xWalkSettings;             return xWalkSettings;
-............ 
         }         }
         catch (Exception e)         catch (Exception e)
Line 178: Line 186:
             e.printStackTrace();             e.printStackTrace();
         }         }
->--->---return null;+        return null;
     }     }
- 
- 
 </code> </code>
  
  • tips/cordova.1424099894.txt.gz
  • Last modified: 2015/02/16 16:18
  • by scipio