Browse Source

Fixed event and scope order/update issues created by rooms service.

pull/152/head
Simon Eisenmann 11 years ago
parent
commit
6f174f8517
  1. 2
      static/js/directives/audiovideo.js
  2. 2
      static/js/directives/buddylist.js
  3. 2
      static/js/directives/presentation.js
  4. 2
      static/js/directives/screenshare.js
  5. 4
      static/js/mediastream/webrtc.js

2
static/js/directives/audiovideo.js

@ -215,6 +215,7 @@ define(['jquery', 'underscore', 'text!partials/audiovideo.html', 'text!partials/
mediaStream.webrtc.e.on("done", function() { mediaStream.webrtc.e.on("done", function() {
$scope.$apply(function() {
$scope.hasUsermedia = false; $scope.hasUsermedia = false;
$scope.isActive = false; $scope.isActive = false;
$scope.peersTalking = {}; $scope.peersTalking = {};
@ -239,6 +240,7 @@ define(['jquery', 'underscore', 'text!partials/audiovideo.html', 'text!partials/
}); });
$scope.rendererName = $scope.defaultRendererName; $scope.rendererName = $scope.defaultRendererName;
$scope.haveStreams = false; $scope.haveStreams = false;
});
}); });

2
static/js/directives/buddylist.js

@ -42,7 +42,7 @@ define(['underscore', 'text!partials/buddylist.html'], function(_, template) {
}; };
webrtc.e.on("done", function() { webrtc.e.on("done", function() {
updateBuddyListVisibility(); $scope.$apply(updateBuddyListVisibility);
}); });
$scope.$on("room.joined", function(ev) { $scope.$on("room.joined", function(ev) {

2
static/js/directives/presentation.js

@ -704,12 +704,14 @@ define(['jquery', 'underscore', 'text!partials/presentation.html', 'bigscreen'],
}; };
mediaStream.webrtc.e.on("done", function() { mediaStream.webrtc.e.on("done", function() {
$scope.$apply(function() {
_.each($scope.availablePresentations, function(presentation) { _.each($scope.availablePresentations, function(presentation) {
presentation.clear(); presentation.clear();
}); });
$scope.availablePresentations = []; $scope.availablePresentations = [];
$scope.activeDownloads = []; $scope.activeDownloads = [];
}); });
});
$(document).on("keyup", function(event) { $(document).on("keyup", function(event) {
if (!$scope.layout.presentation) { if (!$scope.layout.presentation) {

2
static/js/directives/screenshare.js

@ -318,7 +318,7 @@ define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials
}; };
mediaStream.webrtc.e.on("done", function() { mediaStream.webrtc.e.on("done", function() {
$scope.stopScreenshare(); $scope.$apply($scope.stopScreenshare);
}); });
$scope.$watch("layout.screenshare", function(newval, oldval) { $scope.$watch("layout.screenshare", function(newval, oldval) {

4
static/js/mediastream/webrtc.js

@ -608,17 +608,21 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u
if (reason !== "receivedbye") { if (reason !== "receivedbye") {
this.api.sendBye(id, reason); this.api.sendBye(id, reason);
} }
_.defer(_.bind(function() {
if (this.currentcall && currentcall) { if (this.currentcall && currentcall) {
this.e.triggerHandler("statechange", ["connected", this.currentcall]); this.e.triggerHandler("statechange", ["connected", this.currentcall]);
} else { } else {
this.e.triggerHandler("done", [reason]); this.e.triggerHandler("done", [reason]);
} }
}, this));
return; return;
} }
} }
if (this.currentcall) { if (this.currentcall) {
id = this.currentcall.id; id = this.currentcall.id;
_.defer(_.bind(function() {
this.e.triggerHandler("done", [reason]); this.e.triggerHandler("done", [reason]);
}, this));
} }
this.stop(); this.stop();
if (id) { if (id) {

Loading…
Cancel
Save