|
@@ -86,6 +86,7 @@ function doJoin() {
|
86
|
86
|
window.history.pushState('VideoChat', 'Room: ' + roomnode, window.location.pathname + roomnode);
|
87
|
87
|
}
|
88
|
88
|
}
|
|
89
|
+
|
89
|
90
|
roomjid = roomnode + '@' + config.hosts.muc;
|
90
|
91
|
|
91
|
92
|
if (config.useNicks) {
|
|
@@ -111,7 +112,9 @@ $(document).bind('mediaready.jingle', function (event, stream) {
|
111
|
112
|
updateLargeVideo(localVideoSrc, true, 0);
|
112
|
113
|
|
113
|
114
|
$('#localVideo').click(function () {
|
114
|
|
- updateLargeVideo($(this).attr('src'), true, 0);
|
|
115
|
+ $(document).trigger("video.selected", [false]);
|
|
116
|
+ updateLargeVideo($(this).attr('src'), true, 0);
|
|
117
|
+
|
115
|
118
|
$('video').each(function (idx, el) {
|
116
|
119
|
if (el.id.indexOf('mixedmslabel') != -1) {
|
117
|
120
|
el.volume = 0;
|
|
@@ -217,6 +220,7 @@ $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
|
217
|
220
|
};
|
218
|
221
|
sel.click(
|
219
|
222
|
function () {
|
|
223
|
+ $(document).trigger("video.selected", [false]);
|
220
|
224
|
updateLargeVideo($(this).attr('src'), false, 1);
|
221
|
225
|
}
|
222
|
226
|
);
|
|
@@ -282,6 +286,10 @@ $(document).bind('joined.muc', function (event, jid, info) {
|
282
|
286
|
focus = new ColibriFocus(connection, config.hosts.bridge);
|
283
|
287
|
}
|
284
|
288
|
|
|
289
|
+ if (focus && config.etherpad_base) {
|
|
290
|
+ Etherpad.init();
|
|
291
|
+ }
|
|
292
|
+
|
285
|
293
|
showFocusIndicator();
|
286
|
294
|
|
287
|
295
|
// Once we've joined the muc show the toolbar
|
|
@@ -338,13 +346,13 @@ $(document).bind('left.muc', function (event, jid) {
|
338
|
346
|
$(container).hide();
|
339
|
347
|
resizeThumbnails();
|
340
|
348
|
}
|
341
|
|
-
|
342
|
349
|
if (focus === null && connection.emuc.myroomjid == connection.emuc.list_members[0]) {
|
343
|
350
|
console.log('welcome to our new focus... myself');
|
344
|
351
|
focus = new ColibriFocus(connection, config.hosts.bridge);
|
345
|
352
|
if (Object.keys(connection.emuc.members).length > 0) {
|
346
|
353
|
focus.makeConference(Object.keys(connection.emuc.members));
|
347
|
354
|
}
|
|
355
|
+ $(document).trigger('focusechanged.muc', [focus]);
|
348
|
356
|
}
|
349
|
357
|
else if (focus && Object.keys(connection.emuc.members).length === 0) {
|
350
|
358
|
console.log('everyone left');
|
|
@@ -437,11 +445,11 @@ $(document).bind('presentationadded.muc', function (event, jid, presUrl, current
|
437
|
445
|
setPresentationVisible(true);
|
438
|
446
|
$('#largeVideoContainer').hover(
|
439
|
447
|
function (event) {
|
440
|
|
- if ($('#largeVideo').css('visibility') == 'hidden')
|
|
448
|
+ if (isPresentationVisible())
|
441
|
449
|
$('#reloadPresentation').css({display:'inline-block'});
|
442
|
450
|
},
|
443
|
451
|
function (event) {
|
444
|
|
- if ($('#largeVideo').css('visibility') == 'visible')
|
|
452
|
+ if (!isPresentationVisible())
|
445
|
453
|
$('#reloadPresentation').css({display:'none'});
|
446
|
454
|
else {
|
447
|
455
|
var e = event.toElement || event.relatedTarget;
|
|
@@ -519,6 +527,9 @@ function reloadPresentation() {
|
519
|
527
|
*/
|
520
|
528
|
function setPresentationVisible(visible) {
|
521
|
529
|
if (visible) {
|
|
530
|
+ // Trigger the video.selected event to indicate a change in the large video.
|
|
531
|
+ $(document).trigger("video.selected", [true]);
|
|
532
|
+
|
522
|
533
|
$('#largeVideo').fadeOut(300, function () {
|
523
|
534
|
$('#largeVideo').css({visibility:'hidden'});
|
524
|
535
|
$('#presentation>iframe').fadeIn(300, function() {
|
|
@@ -538,6 +549,10 @@ function setPresentationVisible(visible) {
|
538
|
549
|
}
|
539
|
550
|
}
|
540
|
551
|
|
|
552
|
+var isPresentationVisible = function () {
|
|
553
|
+ return ($('#presentation>iframe') != null && $('#presentation>iframe').css('opacity') == 1);
|
|
554
|
+}
|
|
555
|
+
|
541
|
556
|
/**
|
542
|
557
|
* Updates the large video with the given new video source.
|
543
|
558
|
*/
|
|
@@ -607,15 +622,20 @@ function resizeLarge() {
|
607
|
622
|
$('#presentation>iframe').width(availableWidth);
|
608
|
623
|
$('#presentation>iframe').height(availableWidth / aspectRatio);
|
609
|
624
|
}
|
610
|
|
-
|
|
625
|
+
|
|
626
|
+ if ($('#etherpad>iframe')) {
|
|
627
|
+ $('#etherpad>iframe').width(availableWidth);
|
|
628
|
+ $('#etherpad>iframe').height(availableWidth / aspectRatio);
|
|
629
|
+ }
|
|
630
|
+
|
611
|
631
|
resizeThumbnails();
|
612
|
632
|
}
|
613
|
633
|
|
614
|
634
|
function resizeThumbnails() {
|
615
|
635
|
// Calculate the available height, which is the inner window height minus 39px for the header
|
616
|
|
- // minus 4px for the delimiter lines on the top and bottom of the large video,
|
|
636
|
+ // minus 2px for the delimiter lines on the top and bottom of the large video,
|
617
|
637
|
// minus the 36px space inside the remoteVideos container used for highlighting shadow.
|
618
|
|
- var availableHeight = window.innerHeight - $('#largeVideo').height() - 79;
|
|
638
|
+ var availableHeight = window.innerHeight - $('#largeVideo').height() - 59;
|
619
|
639
|
var numvids = $('#remoteVideos>span:visible').length;
|
620
|
640
|
|
621
|
641
|
// Remove the 1px borders arround videos and the chat width.
|
|
@@ -629,7 +649,7 @@ function resizeThumbnails() {
|
629
|
649
|
}
|
630
|
650
|
|
631
|
651
|
// size videos so that while keeping AR and max height, we have a nice fit
|
632
|
|
- $('#remoteVideos').height(availableHeight+26); // add the 2*18px-padding-top border used for highlighting shadow.
|
|
652
|
+ $('#remoteVideos').height(availableHeight);
|
633
|
653
|
$('#remoteVideos>span').width(availableWidth);
|
634
|
654
|
$('#remoteVideos>span').height(availableHeight);
|
635
|
655
|
}
|