repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 4ba370943527d30a8a83c3ef9878871f653b5d7f:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 4ba370943527d30a8a83c3ef9878871f653b5d7f
Author: James Baicoianu 
Date:   Sat Oct 21 10:53:02 2017 -0700

    More robust gaze object handling

diff --git a/scripts/janusplayer.js b/scripts/janusplayer.js
index ac2313090740f910a28f86216f9a2eab7bec8e55..
index ..6be330e9cfae23357e236fe1aeb43b4c92f9bc62 100644
--- a/scripts/janusplayer.js
+++ b/scripts/janusplayer.js
@@ -315,9 +315,14 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
         v.view_zdir.negate();
       }

-      if (this.gaze) {
+      if (this.gaze && this.gaze.object) {
         var now = performance.now();
-        var gazetime = this.gaze.object.gazetime || this.gaze.object.room.gazetime || 1000;;
+        var gazetime = 1000;
+        if (this.gaze.object.gazetime) {
+          gazetime = this.gaze.object.gazetime;
+        } else if (this.gaze.object.room && this.gaze.object.room.gazetime) {
+          gazetime = this.gaze.object.room.gazetime;;
+        }
         var diff = now - this.gaze.start;
         var percent = diff / gazetime;
         if (percent < 1) {

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