summary refs log tree commit diff
path: root/webclient/app-controller.js
diff options
context:
space:
mode:
authorDavid Baker <dbkr@matrix.org>2014-09-18 15:51:30 +0100
committerDavid Baker <dbkr@matrix.org>2014-09-18 15:51:30 +0100
commit3bd8cbc62fd8ac47acd56ec50360259f6098c66b (patch)
treea0db10c55eb9db72564d3cf8f91678d04ca62c81 /webclient/app-controller.js
parentWIP video chat layout (diff)
downloadsynapse-3bd8cbc62fd8ac47acd56ec50360259f6098c66b.tar.xz
Prettier and stabler video with basic support for viewing mode. For now, transition into 'large' mode is disabled.
Diffstat (limited to 'webclient/app-controller.js')
-rw-r--r--webclient/app-controller.js22
1 files changed, 20 insertions, 2 deletions
diff --git a/webclient/app-controller.js b/webclient/app-controller.js
index f63bb32f4f..7f48148aaa 100644
--- a/webclient/app-controller.js
+++ b/webclient/app-controller.js
@@ -93,7 +93,13 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even
     };
 
     $rootScope.$watch('currentCall', function(newVal, oldVal) {
-        if (!$rootScope.currentCall) return;
+        if (!$rootScope.currentCall) {
+            // This causes the still frame to be flushed out of the video elements,
+            // avoiding a flash of the last frame of the previous call when starting the next
+            angular.element('#localVideo')[0].load();
+            angular.element('#remoteVideo')[0].load();
+            return;
+        }
 
         var roomMembers = angular.copy($rootScope.events.rooms[$rootScope.currentCall.room_id].members);
         delete roomMembers[matrixService.config().user_id];
@@ -140,7 +146,19 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even
         } else if (oldVal == 'ringing') {
             angular.element('#ringAudio')[0].pause();
         } else if (newVal == 'connected') {
-            $scope.videoMode = 'large';
+            $timeout(function() {
+                //if ($scope.currentCall.type == 'video') $scope.videoMode = 'large';
+            }, 5000);
+        }
+
+        if ($rootScope.currentCall && $rootScope.currentCall.type == 'video' && $rootScope.currentCall.state != 'connected') {
+            $scope.videoMode = 'mini';
+        }
+    });
+    $rootScope.$watch('currentCall.type', function(newVal, oldVal) {
+        // need to listen for this too as the type of the call won't be know when it's created
+        if ($rootScope.currentCall && $rootScope.currentCall.type == 'video' && $rootScope.currentCall.state != 'connected') {
+            $scope.videoMode = 'mini';
         }
     });