|
@@ -46,7 +46,7 @@ function init() {
|
46
|
46
|
if (RTC.browser == 'firefox') {
|
47
|
47
|
getUserMediaWithConstraints(['audio']);
|
48
|
48
|
} else {
|
49
|
|
- getUserMediaWithConstraints(['audio', 'video'], config.resolution || '360');
|
|
49
|
+ getUserMediaWithConstraints(['audio', 'video'], '360');
|
50
|
50
|
}
|
51
|
51
|
document.getElementById('connect').disabled = true;
|
52
|
52
|
} else {
|
|
@@ -99,6 +99,7 @@ function doJoin() {
|
99
|
99
|
$(document).bind('mediaready.jingle', function (event, stream) {
|
100
|
100
|
connection.jingle.localStream = stream;
|
101
|
101
|
RTC.attachMediaStream($('#localVideo'), stream);
|
|
102
|
+ document.getElementById('localVideo').muted = true;
|
102
|
103
|
document.getElementById('localVideo').autoplay = true;
|
103
|
104
|
document.getElementById('localVideo').volume = 0;
|
104
|
105
|
|
|
@@ -106,13 +107,7 @@ $(document).bind('mediaready.jingle', function (event, stream) {
|
106
|
107
|
updateLargeVideo(localVideoSrc, true, 0);
|
107
|
108
|
|
108
|
109
|
$('#localVideo').click(function () {
|
109
|
|
- updateLargeVideo($(this).attr('src'), true, 0);
|
110
|
|
- $('video').each(function (idx, el) {
|
111
|
|
- if (el.id.indexOf('mixedmslabel') != -1) {
|
112
|
|
- el.volume = 0;
|
113
|
|
- el.volume = 1;
|
114
|
|
- }
|
115
|
|
- });
|
|
110
|
+ updateLargeVideo($(this).attr('src'), true, 1);
|
116
|
111
|
});
|
117
|
112
|
|
118
|
113
|
doJoin();
|
|
@@ -432,13 +427,6 @@ $(document).bind('presentationadded.muc', function (event, jid, presUrl, current
|
432
|
427
|
});
|
433
|
428
|
|
434
|
429
|
$('#presentation>iframe').attr('id', preziPlayer.options.preziId);
|
435
|
|
-
|
436
|
|
-// $('#presentation>iframe').load(function (){
|
437
|
|
-// console.log("IFRAME LOADED!!!!!!!!!!!!!!!!");
|
438
|
|
-// });
|
439
|
|
-// $('#presentation>iframe').ready(function (){
|
440
|
|
-// console.log("IFRAME READY!!!!!!!!!!!!!!!!");
|
441
|
|
-// });
|
442
|
430
|
|
443
|
431
|
preziPlayer.on(PreziPlayer.EVENT_STATUS, function(event) {
|
444
|
432
|
console.log("prezi status", event.value);
|
|
@@ -554,6 +542,7 @@ function toggleAudio() {
|
554
|
542
|
}
|
555
|
543
|
|
556
|
544
|
function resizeLarge() {
|
|
545
|
+ resizeChat();
|
557
|
546
|
var availableHeight = window.innerHeight;
|
558
|
547
|
var chatspaceWidth = $('#chatspace').width();
|
559
|
548
|
|
|
@@ -588,10 +577,8 @@ function resizeThumbnails() {
|
588
|
577
|
var availableHeight = window.innerHeight - $('#largeVideo').height() - 79;
|
589
|
578
|
var numvids = $('#remoteVideos>span:visible').length;
|
590
|
579
|
|
591
|
|
- var chatWidth = $('#chatspace').width();
|
592
|
|
-
|
593
|
580
|
// Remove the 1px borders arround videos and the chat width.
|
594
|
|
- var availableWinWidth = $('#remoteVideos').width() - 2 * numvids - chatWidth - 50;
|
|
581
|
+ var availableWinWidth = $('#remoteVideos').width() - 2 * numvids - 50;
|
595
|
582
|
var availableWidth = availableWinWidth / numvids;
|
596
|
583
|
var aspectRatio = 16.0 / 9.0;
|
597
|
584
|
var maxHeight = Math.min(160, availableHeight);
|
|
@@ -599,12 +586,35 @@ function resizeThumbnails() {
|
599
|
586
|
if (availableHeight < availableWidth / aspectRatio) {
|
600
|
587
|
availableWidth = Math.floor(availableHeight * aspectRatio);
|
601
|
588
|
}
|
|
589
|
+
|
602
|
590
|
// size videos so that while keeping AR and max height, we have a nice fit
|
603
|
591
|
$('#remoteVideos').height(availableHeight+26); // add the 2*18px-padding-top border used for highlighting shadow.
|
604
|
592
|
$('#remoteVideos>span').width(availableWidth);
|
605
|
593
|
$('#remoteVideos>span').height(availableHeight);
|
606
|
594
|
}
|
607
|
595
|
|
|
596
|
+function resizeChat() {
|
|
597
|
+ var availableHeight = window.innerHeight;
|
|
598
|
+ var availableWidth = window.innerWidth;
|
|
599
|
+
|
|
600
|
+ var chatWidth = 200;
|
|
601
|
+ if (availableWidth*0.2 < 200)
|
|
602
|
+ chatWidth = availableWidth*0.2;
|
|
603
|
+
|
|
604
|
+ $('#chatspace').width(chatWidth);
|
|
605
|
+ $('#chatspace').height(availableHeight - 40);
|
|
606
|
+
|
|
607
|
+ resizeChatConversation();
|
|
608
|
+}
|
|
609
|
+
|
|
610
|
+function resizeChatConversation() {
|
|
611
|
+ var usermsgStyleHeight = document.getElementById("usermsg").style.height;
|
|
612
|
+ var usermsgHeight = usermsgStyleHeight.substring(0, usermsgStyleHeight.indexOf('px'));
|
|
613
|
+
|
|
614
|
+ $('#chatconversation').width($('#chatspace').width() - 10);
|
|
615
|
+ $('#chatconversation').height(window.innerHeight - 50 - parseInt(usermsgHeight));
|
|
616
|
+}
|
|
617
|
+
|
608
|
618
|
$(document).ready(function () {
|
609
|
619
|
$('#nickinput').keydown(function(event) {
|
610
|
620
|
if (event.keyCode == 13) {
|
|
@@ -632,7 +642,11 @@ $(document).ready(function () {
|
632
|
642
|
}
|
633
|
643
|
});
|
634
|
644
|
|
635
|
|
- $('#usermsg').autosize();
|
|
645
|
+ var onTextAreaResize = function() {
|
|
646
|
+ resizeChatConversation();
|
|
647
|
+ scrollChatToBottom();
|
|
648
|
+ };
|
|
649
|
+ $('#usermsg').autosize({callback: onTextAreaResize});
|
636
|
650
|
|
637
|
651
|
// Set the defaults for prompt dialogs.
|
638
|
652
|
jQuery.prompt.setDefaults({persistent: false});
|
|
@@ -972,18 +986,30 @@ function updateLockButton() {
|
972
|
986
|
function openChat() {
|
973
|
987
|
var chatspace = $('#chatspace');
|
974
|
988
|
var videospace = $('#videospace');
|
975
|
|
- var onAnimationProgress = function () {
|
|
989
|
+
|
|
990
|
+ var onShow = function () {
|
|
991
|
+ resizeLarge();
|
|
992
|
+ $('#chatspace').show("slide", { direction: "right", duration: 500});
|
|
993
|
+ };
|
|
994
|
+ var onHide = function () {
|
|
995
|
+ $('#chatspace').hide("slide", { direction: "right", duration: 500});
|
976
|
996
|
resizeLarge();
|
977
|
|
- videospace.css({right:chatspace.width()});
|
978
|
997
|
};
|
979
|
998
|
|
980
|
|
- if (chatspace.css("opacity") == 1) {
|
981
|
|
- chatspace.animate({width: 0, opacity: 0}, {duration: 1000, progress: onAnimationProgress});
|
|
999
|
+ if (chatspace.css("display") == 'block') {
|
|
1000
|
+ videospace.animate({right: 0}, {queue: false, duration: 500, progress: onHide});
|
982
|
1001
|
}
|
983
|
1002
|
else {
|
984
|
|
- chatspace.animate({width:"20%", opacity: 1}, {duration: 1000, progress: onAnimationProgress});
|
|
1003
|
+ videospace.animate({right: chatspace.width()},
|
|
1004
|
+ {queue: false,
|
|
1005
|
+ duration: 500,
|
|
1006
|
+ progress: onShow,
|
|
1007
|
+ complete: function() {
|
|
1008
|
+ scrollChatToBottom();
|
|
1009
|
+ }
|
|
1010
|
+ });
|
985
|
1011
|
}
|
986
|
|
-
|
|
1012
|
+
|
987
|
1013
|
// Request the focus in the nickname field or the chat input field.
|
988
|
1014
|
if ($('#nickinput').is(':visible'))
|
989
|
1015
|
$('#nickinput').focus();
|
|
@@ -1069,3 +1095,9 @@ function createFocusIndicatorElement(parentElement) {
|
1069
|
1095
|
focusIndicator.title = "The owner of this conference"
|
1070
|
1096
|
parentElement.appendChild(focusIndicator);
|
1071
|
1097
|
}
|
|
1098
|
+
|
|
1099
|
+function scrollChatToBottom() {
|
|
1100
|
+ setTimeout(function() {
|
|
1101
|
+ $('#chatconversation').scrollTop($('#chatconversation')[0].scrollHeight);
|
|
1102
|
+ }, 5);
|
|
1103
|
+}
|