Browse Source

Always show own video when in conference room.

pull/284/head
Joachim Bauch 9 years ago
parent
commit
8fa2083c74
  1. 32
      static/js/controllers/uicontroller.js
  2. 14
      static/js/directives/audiovideo.js
  3. 14
      static/js/mediastream/webrtc.js
  4. 4
      static/partials/audiovideo.html
  5. 4
      static/partials/ui.html

32
static/js/controllers/uicontroller.js

@ -200,6 +200,10 @@ define(['jquery', 'underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'web @@ -200,6 +200,10 @@ define(['jquery', 'underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'web
localStatus.update(status);
};
$scope.isConferenceRoom = function() {
return mediaStream.webrtc.isConferenceRoom();
};
$scope.updatePeerFromConference = function() {
if (!$scope.conferenceObject) {
return;
@ -232,6 +236,14 @@ define(['jquery', 'underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'web @@ -232,6 +236,14 @@ define(['jquery', 'underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'web
}
};
$scope.clearConnectedStatus = function() {
if (mediaStream.connector.connected) {
$scope.setStatus("waiting");
} else {
$scope.setStatus("closed");
}
};
$scope.refreshWebrtcSettings = function() {
var settings = $scope.master.settings;
// Refresh SDP params.
@ -485,6 +497,20 @@ define(['jquery', 'underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'web @@ -485,6 +497,20 @@ define(['jquery', 'underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'web
scope.conferenceObject = peerconference ? peerconference : null;
scope.updatePeerFromConference();
scope.setConnectedStatus();
if (!peerconference) {
scope.peer = null;
if (scope.usermedia) {
$timeout(function() {
scope.usermedia = null;
mediaStream.webrtc.stop();
if (mediaStream.webrtc.isConferenceRoom()) {
mediaStream.webrtc.doUserMediaWithInternalCall();
}
$scope.layout.buddylist = true;
$scope.layout.buddylistAutoHide = false;
}, 0);
}
}
});
});
@ -714,11 +740,7 @@ define(['jquery', 'underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'web @@ -714,11 +740,7 @@ define(['jquery', 'underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'web
mediaStream.webrtc.e.on("done stop", function() {
safeApply($scope, function(scope) {
if (mediaStream.connector.connected) {
scope.setStatus("waiting");
} else {
scope.setStatus("closed");
}
scope.clearConnectedStatus();
});
});

14
static/js/directives/audiovideo.js

@ -289,23 +289,31 @@ define(['jquery', 'underscore', 'text!partials/audiovideo.html', 'text!partials/ @@ -289,23 +289,31 @@ define(['jquery', 'underscore', 'text!partials/audiovideo.html', 'text!partials/
});
mediaStream.webrtc.e.on("done", function() {
mediaStream.webrtc.e.on("done stop", function(event) {
$scope.$apply(function() {
if (!$scope.isActive) {
return;
}
$scope.hasUsermedia = false;
$scope.isActive = false;
$scope.peersTalking = {};
if (BigScreen.enabled) {
BigScreen.exit();
}
_.delay(function() {
var removeVideos = function() {
if ($scope.isActive) {
return;
}
$scope.localVideo.src = '';
$scope.miniVideo.src = '';
$($scope.remoteVideos).children(".remoteVideo").remove();
}, 1500);
};
if (event.type === "stop") {
removeVideos();
} else {
$timeout(removeVideos, 1500);
}
$($scope.mini).removeClass("visible");
$scope.localVideos.style.opacity = 1;
$scope.localVideo.style.opacity = 0;

14
static/js/mediastream/webrtc.js

@ -159,6 +159,15 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u @@ -159,6 +159,15 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u
WebRTC.prototype.receivedRoom = function(event, room) {
this.currentroom = room;
if (this.isConferenceRoom()) {
if (!this.usermedia) {
this.doUserMediaWithInternalCall();
}
} else {
if (this.currentcall && this.currentcall.isinternal) {
this.stop();
}
}
};
WebRTC.prototype.isConferenceRoom = function() {
@ -440,11 +449,12 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u @@ -440,11 +449,12 @@ function($, _, PeerCall, PeerConference, PeerXfer, PeerScreenshare, UserMedia, u
};
WebRTC.prototype.doUserMediaWithInternalCall = function() {
if (this.currentcall) {
console.warn("Already have a current call, not doing internal getUM");
if (this.currentcall && !this.currentcall.isinternal) {
console.warn("Already have a current call, not doing internal getUM", this.currentcall);
return;
}
var currentcall = this.currentcall = new InternalCall(this);
this.e.triggerHandler("peercall", [currentcall]);
this.doUserMedia(currentcall);
};

4
static/partials/audiovideo.html

@ -15,10 +15,10 @@ @@ -15,10 +15,10 @@
</div>
</div>
</div>
<div class="overlayActions">
<div class="overlayActions" ng-show="peer">
<button class="btn btn-link renderer-democrazy" title="{{_('Standard view')}}" ng-click="setRenderer('democrazy')"><i class="fa fa-table"></i></button>
<button class="btn btn-link renderer-onepeople" title="{{_('Large view')}}" ng-click="setRenderer('onepeople')"><i class="fa fa-plus-square" ></i></button>
<button class="btn btn-link renderer-conferencekiosk" title="{{_('Kiosk view')}}" ng-click="setRenderer('conferencekiosk')"><i class="fa fa-user"></i></button>
<button class="btn btn-link renderer-auditorium" title="{{_('Auditorium')}}" ng-click="setRenderer('auditorium')"><i class="fa fa-male"></i><span class="fa"></span></button>
</div>
</div>
</div>

4
static/partials/ui.html

@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
<div id="audiolevel" class="ng-cloak">
<div class="audio-level" title="{{_('Your audio level')}}"></div>
</div>
<div id="audiovideo" class="ng-cloak" ng-show="peer">
<div id="audiovideo" class="ng-cloak" ng-show="peer || isConferenceRoom()">
<audio-video/>
</div>
<div id="screenshare" class="ng-cloak mainview">
@ -49,4 +49,4 @@ @@ -49,4 +49,4 @@
</div>
</div>
<div class="ng-cloak" id="settings" ng-class="{show: layout.settings}"><settings/></div>
</chat>
</chat>

Loading…
Cancel
Save