repo: janusweb
action: commit
revision: 
path_from: 
revision_from: b03cee4887948ee56876310549edb725dcaba76b:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit b03cee4887948ee56876310549edb725dcaba76b
Author: James Baicoianu 
Date:   Mon Feb 27 00:11:47 2017 -0800

    Call room.start() on the first touch, to make sure videos start on mobile

diff --git a/scripts/room.js b/scripts/room.js
index ee020c94499f0cd8811d3e7bd4913df2787d97b7..
index ..82b5d4a8ea937608ed41eb7ed7b59fec8d260786 100644
--- a/scripts/room.js
+++ b/scripts/room.js
@@ -64,6 +64,7 @@ elation.require([
         elation.events.add(this.engine.systems.admin, 'admin_edit_change', elation.bind(this, this.onRoomEdit));
       }
       //this.showDebug();
+      elation.events.add(window, 'touchstart', elation.bind(this, this.onTouchStart));
       elation.events.add(window, 'keydown', elation.bind(this, this.onKeyDown));
       elation.events.add(window, 'keyup', elation.bind(this, this.onKeyUp));

@@ -935,6 +936,12 @@ elation.require([
     this.onMouseUp = function(ev) { 
       elation.events.fire({type: 'janus_room_mouseup', element: this, event: ev});
     }
+    this.onTouchStart = function(ev) { 
+      if (!this.firsttouch) {
+        this.firsttouch = true;
+        this.start();
+      }
+    }
     this.onThingChange = function(ev) {
       var thing = ev.target;
       if (!this.applyingEdits && thing.js_id && this.jsobjects[thing.js_id]) {

-----END OF PAGE-----