|
@@ -24,12 +24,12 @@ var currentVideoWidth = null;
|
24
|
24
|
var currentVideoHeight = null;
|
25
|
25
|
/**
|
26
|
26
|
* Method used to calculate large video size.
|
27
|
|
- * @type {function()}
|
|
27
|
+ * @type {function ()}
|
28
|
28
|
*/
|
29
|
29
|
var getVideoSize;
|
30
|
30
|
/**
|
31
|
31
|
* Method used to get large video position.
|
32
|
|
- * @type {function()}
|
|
32
|
+ * @type {function ()}
|
33
|
33
|
*/
|
34
|
34
|
var getVideoPosition;
|
35
|
35
|
|
|
@@ -40,9 +40,11 @@ function init() {
|
40
|
40
|
if (RTC === null) {
|
41
|
41
|
window.location.href = 'webrtcrequired.html';
|
42
|
42
|
return;
|
|
43
|
+ /*
|
43
|
44
|
} else if (RTC.browser !== 'chrome') {
|
44
|
45
|
window.location.href = 'chromeonly.html';
|
45
|
46
|
return;
|
|
47
|
+ */
|
46
|
48
|
}
|
47
|
49
|
|
48
|
50
|
connection = new Strophe.Connection(document.getElementById('boshURL').value || config.bosh || '/http-bind');
|
|
@@ -69,9 +71,9 @@ function init() {
|
69
|
71
|
if (config.useStunTurn) {
|
70
|
72
|
connection.jingle.getStunAndTurnCredentials();
|
71
|
73
|
}
|
72
|
|
- obtainAudioAndVideoPermissions(function(){
|
73
|
|
- getUserMediaWithConstraints( ['audio'], audioStreamReady,
|
74
|
|
- function(error){
|
|
74
|
+ obtainAudioAndVideoPermissions(function () {
|
|
75
|
+ getUserMediaWithConstraints(['audio'], audioStreamReady,
|
|
76
|
+ function (error) {
|
75
|
77
|
console.error('failed to obtain audio stream - stop', error);
|
76
|
78
|
});
|
77
|
79
|
});
|
|
@@ -88,20 +90,20 @@ function init() {
|
88
|
90
|
* We first ask for audio and video combined stream in order to get permissions and not to ask twice.
|
89
|
91
|
* Then we dispose the stream and continue with separate audio, video streams(required for desktop sharing).
|
90
|
92
|
*/
|
91
|
|
-function obtainAudioAndVideoPermissions(callback){
|
|
93
|
+function obtainAudioAndVideoPermissions(callback) {
|
92
|
94
|
// This makes sense only on https sites otherwise we'll be asked for permissions every time
|
93
|
|
- if(location.protocol !== 'https:') {
|
|
95
|
+ if (location.protocol !== 'https:') {
|
94
|
96
|
callback();
|
95
|
97
|
return;
|
96
|
98
|
}
|
97
|
99
|
// Get AV
|
98
|
100
|
getUserMediaWithConstraints(
|
99
|
101
|
['audio', 'video'],
|
100
|
|
- function(avStream) {
|
|
102
|
+ function (avStream) {
|
101
|
103
|
avStream.stop();
|
102
|
104
|
callback();
|
103
|
105
|
},
|
104
|
|
- function(error){
|
|
106
|
+ function (error) {
|
105
|
107
|
console.error('failed to obtain audio/video stream - stop', error);
|
106
|
108
|
});
|
107
|
109
|
}
|
|
@@ -110,8 +112,8 @@ function audioStreamReady(stream) {
|
110
|
112
|
|
111
|
113
|
change_local_audio(stream);
|
112
|
114
|
|
113
|
|
- if(RTC.browser !== 'firefox') {
|
114
|
|
- getUserMediaWithConstraints( ['video'], videoStreamReady, videoStreamFailed, config.resolution || '360' );
|
|
115
|
+ if (RTC.browser !== 'firefox') {
|
|
116
|
+ getUserMediaWithConstraints(['video'], videoStreamReady, videoStreamFailed, config.resolution || '360');
|
115
|
117
|
} else {
|
116
|
118
|
doJoin();
|
117
|
119
|
}
|
|
@@ -169,7 +171,7 @@ function doJoin() {
|
169
|
171
|
roomjid += '/' + Strophe.getNodeFromJid(connection.jid);
|
170
|
172
|
}
|
171
|
173
|
} else {
|
172
|
|
- roomjid += '/' + Strophe.getNodeFromJid(connection.jid).substr(0,8);
|
|
174
|
+ roomjid += '/' + Strophe.getNodeFromJid(connection.jid).substr(0, 8);
|
173
|
175
|
}
|
174
|
176
|
connection.emuc.doJoin(roomjid);
|
175
|
177
|
}
|
|
@@ -186,7 +188,7 @@ function change_local_video(stream, flipX) {
|
186
|
188
|
connection.jingle.localVideo = stream;
|
187
|
189
|
|
188
|
190
|
var localVideo = document.createElement('video');
|
189
|
|
- localVideo.id = 'localVideo_'+stream.id;
|
|
191
|
+ localVideo.id = 'localVideo_' + stream.id;
|
190
|
192
|
localVideo.autoplay = true;
|
191
|
193
|
localVideo.volume = 0; // is it required if audio is separated ?
|
192
|
194
|
localVideo.oncontextmenu = function () { return false; };
|
|
@@ -196,7 +198,9 @@ function change_local_video(stream, flipX) {
|
196
|
198
|
|
197
|
199
|
var localVideoSelector = $('#' + localVideo.id);
|
198
|
200
|
// Add click handler
|
199
|
|
- localVideoSelector.click(function () { handleVideoThumbClicked(localVideo.src); } );
|
|
201
|
+ localVideoSelector.click(function () {
|
|
202
|
+ handleVideoThumbClicked(localVideo.src);
|
|
203
|
+ });
|
200
|
204
|
// Add stream ended handler
|
201
|
205
|
stream.onended = function () {
|
202
|
206
|
localVideoContainer.removeChild(localVideo);
|
|
@@ -204,7 +208,7 @@ function change_local_video(stream, flipX) {
|
204
|
208
|
};
|
205
|
209
|
// Flip video x axis if needed
|
206
|
210
|
flipXLocalVideo = flipX;
|
207
|
|
- if(flipX) {
|
|
211
|
+ if (flipX) {
|
208
|
212
|
localVideoSelector.addClass("flipVideoX");
|
209
|
213
|
}
|
210
|
214
|
// Attach WebRTC stream
|
|
@@ -216,7 +220,7 @@ function change_local_video(stream, flipX) {
|
216
|
220
|
|
217
|
221
|
$(document).bind('remotestreamadded.jingle', function (event, data, sid) {
|
218
|
222
|
function waitForRemoteVideo(selector, sid, ssrc) {
|
219
|
|
- if(selector.removed) {
|
|
223
|
+ if (selector.removed) {
|
220
|
224
|
console.warn("media removed before had started", selector);
|
221
|
225
|
return;
|
222
|
226
|
}
|
|
@@ -230,7 +234,7 @@ $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
|
230
|
234
|
|
231
|
235
|
// FIXME: add a class that will associate peer Jid, video.src, it's ssrc and video type
|
232
|
236
|
// in order to get rid of too many maps
|
233
|
|
- if(ssrc) {
|
|
237
|
+ if (ssrc) {
|
234
|
238
|
videoSrcToSsrc[sel.attr('src')] = ssrc;
|
235
|
239
|
} else {
|
236
|
240
|
console.warn("No ssrc given for video", sel);
|
|
@@ -250,7 +254,7 @@ $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
|
250
|
254
|
var ssrclines = SDPUtil.find_lines(sess.peerconnection.remoteDescription.sdp, 'a=ssrc');
|
251
|
255
|
ssrclines = ssrclines.filter(function (line) {
|
252
|
256
|
return line.indexOf('mslabel:' + data.stream.label) !== -1;
|
253
|
|
- });
|
|
257
|
+ });
|
254
|
258
|
if (ssrclines.length) {
|
255
|
259
|
thessrc = ssrclines[0].substring(7).split(' ')[0];
|
256
|
260
|
// ok to overwrite the one from focus? might save work in colibri.js
|
|
@@ -305,7 +309,7 @@ $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
|
305
|
309
|
sel.hide();
|
306
|
310
|
RTC.attachMediaStream(sel, data.stream);
|
307
|
311
|
|
308
|
|
- if(isVideo) {
|
|
312
|
+ if (isVideo) {
|
309
|
313
|
waitForRemoteVideo(sel, sid, thessrc);
|
310
|
314
|
}
|
311
|
315
|
|
|
@@ -316,9 +320,9 @@ $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
|
316
|
320
|
sel.removed = true;
|
317
|
321
|
sel.remove();
|
318
|
322
|
|
319
|
|
- var audioCount = $('#'+container.id+'>audio').length;
|
320
|
|
- var videoCount = $('#'+container.id+'>video').length;
|
321
|
|
- if(!audioCount && !videoCount) {
|
|
323
|
+ var audioCount = $('#' + container.id + '>audio').length;
|
|
324
|
+ var videoCount = $('#' + container.id + '>video').length;
|
|
325
|
+ if (!audioCount && !videoCount) {
|
322
|
326
|
console.log("Remove whole user");
|
323
|
327
|
// Remove whole container
|
324
|
328
|
container.remove();
|
|
@@ -330,14 +334,17 @@ $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
|
330
|
334
|
};
|
331
|
335
|
|
332
|
336
|
// Add click handler
|
333
|
|
- sel.click(function () { handleVideoThumbClicked(vid.src); });
|
|
337
|
+ sel.click(function () {
|
|
338
|
+ handleVideoThumbClicked(vid.src);
|
|
339
|
+ });
|
334
|
340
|
|
335
|
341
|
// an attempt to work around https://github.com/jitsi/jitmeet/issues/32
|
336
|
|
- if (isVideo
|
337
|
|
- && data.peerjid && sess.peerjid === data.peerjid &&
|
338
|
|
- data.stream.getVideoTracks().length === 0 &&
|
339
|
|
- connection.jingle.localVideo.getVideoTracks().length > 0) {
|
340
|
|
- window.setTimeout(function() {
|
|
342
|
+ if (isVideo &&
|
|
343
|
+ data.peerjid && sess.peerjid === data.peerjid &&
|
|
344
|
+ data.stream.getVideoTracks().length === 0 &&
|
|
345
|
+ connection.jingle.localVideo.getVideoTracks().length > 0) {
|
|
346
|
+ //
|
|
347
|
+ window.setTimeout(function () {
|
341
|
348
|
sendKeyframe(sess.peerconnection);
|
342
|
349
|
}, 3000);
|
343
|
350
|
}
|
|
@@ -361,17 +368,17 @@ function handleVideoThumbClicked(videoSrc) {
|
361
|
368
|
* Checks if removed video is currently displayed and tries to display another one instead.
|
362
|
369
|
* @param removedVideoSrc src stream identifier of the video.
|
363
|
370
|
*/
|
364
|
|
-function checkChangeLargeVideo(removedVideoSrc){
|
|
371
|
+function checkChangeLargeVideo(removedVideoSrc) {
|
365
|
372
|
if (removedVideoSrc === $('#largeVideo').attr('src')) {
|
366
|
373
|
// this is currently displayed as large
|
367
|
374
|
// pick the last visible video in the row
|
368
|
375
|
// if nobody else is left, this picks the local video
|
369
|
376
|
var pick = $('#remoteVideos>span[id!="mixedstream"]:visible:last>video').get(0);
|
370
|
377
|
|
371
|
|
- if(!pick) {
|
|
378
|
+ if (!pick) {
|
372
|
379
|
console.info("Last visible video no longer exists");
|
373
|
380
|
pick = $('#remoteVideos>span[id!="mixedstream"]>video').get(0);
|
374
|
|
- if(!pick) {
|
|
381
|
+ if (!pick) {
|
375
|
382
|
// Try local video
|
376
|
383
|
console.info("Fallback to local video...");
|
377
|
384
|
pick = $('#remoteVideos>span>span>video').get(0);
|
|
@@ -396,8 +403,10 @@ function sendKeyframe(pc) {
|
396
|
403
|
function () {
|
397
|
404
|
pc.createAnswer(
|
398
|
405
|
function (modifiedAnswer) {
|
399
|
|
- pc.setLocalDescription(modifiedAnswer,
|
|
406
|
+ pc.setLocalDescription(
|
|
407
|
+ modifiedAnswer,
|
400
|
408
|
function () {
|
|
409
|
+ // noop
|
401
|
410
|
},
|
402
|
411
|
function (error) {
|
403
|
412
|
console.log('triggerKeyframe setLocalDescription failed', error);
|
|
@@ -436,7 +445,7 @@ function muteVideo(pc, unmute) {
|
436
|
445
|
function () {
|
437
|
446
|
console.log('mute SLD ok');
|
438
|
447
|
},
|
439
|
|
- function(error) {
|
|
448
|
+ function (error) {
|
440
|
449
|
console.log('mute SLD error');
|
441
|
450
|
}
|
442
|
451
|
);
|
|
@@ -497,11 +506,11 @@ $(document).bind('setLocalDescription.jingle', function (event, sid) {
|
497
|
506
|
newssrcs[type] = ssrc;
|
498
|
507
|
|
499
|
508
|
directions[type] = (
|
500
|
|
- SDPUtil.find_line(media, 'a=sendrecv')
|
501
|
|
- || SDPUtil.find_line(media, 'a=recvonly')
|
502
|
|
- || SDPUtil.find_line('a=sendonly')
|
503
|
|
- || SDPUtil.find_line('a=inactive')
|
504
|
|
- || 'a=sendrecv' ).substr(2);
|
|
509
|
+ SDPUtil.find_line(media, 'a=sendrecv') ||
|
|
510
|
+ SDPUtil.find_line(media, 'a=recvonly') ||
|
|
511
|
+ SDPUtil.find_line('a=sendonly') ||
|
|
512
|
+ SDPUtil.find_line('a=inactive') ||
|
|
513
|
+ 'a=sendrecv').substr(2);
|
505
|
514
|
}
|
506
|
515
|
});
|
507
|
516
|
console.log('new ssrcs', newssrcs);
|
|
@@ -513,7 +522,7 @@ $(document).bind('setLocalDescription.jingle', function (event, sid) {
|
513
|
522
|
i++;
|
514
|
523
|
var type = mtype;
|
515
|
524
|
// Change video type to screen
|
516
|
|
- if(mtype === 'video' && isUsingScreenStream) {
|
|
525
|
+ if (mtype === 'video' && isUsingScreenStream) {
|
517
|
526
|
type = 'screen';
|
518
|
527
|
}
|
519
|
528
|
connection.emuc.addMediaToPresence(i, type, newssrcs[mtype], directions[mtype]);
|
|
@@ -603,13 +612,13 @@ $(document).bind('left.muc', function (event, jid) {
|
603
|
612
|
$(document).bind('presence.muc', function (event, jid, info, pres) {
|
604
|
613
|
|
605
|
614
|
// Remove old ssrcs coming from the jid
|
606
|
|
- Object.keys(ssrc2jid).forEach(function(ssrc){
|
607
|
|
- if(ssrc2jid[ssrc] == jid){
|
608
|
|
- delete ssrc2jid[ssrc];
|
609
|
|
- }
|
610
|
|
- if(ssrc2videoType == jid){
|
611
|
|
- delete ssrc2videoType[ssrc];
|
612
|
|
- }
|
|
615
|
+ Object.keys(ssrc2jid).forEach(function (ssrc) {
|
|
616
|
+ if (ssrc2jid[ssrc] == jid) {
|
|
617
|
+ delete ssrc2jid[ssrc];
|
|
618
|
+ }
|
|
619
|
+ if (ssrc2videoType == jid) {
|
|
620
|
+ delete ssrc2videoType[ssrc];
|
|
621
|
+ }
|
613
|
622
|
});
|
614
|
623
|
|
615
|
624
|
$(pres).find('>media[xmlns="http://estos.de/ns/mjs"]>source').each(function (idx, ssrc) {
|
|
@@ -623,7 +632,7 @@ $(document).bind('presence.muc', function (event, jid, info, pres) {
|
623
|
632
|
// might need to update the direction if participant just went from sendrecv to recvonly
|
624
|
633
|
if (type === 'video' || type === 'screen') {
|
625
|
634
|
var el = $('#participant_' + Strophe.getResourceFromJid(jid) + '>video');
|
626
|
|
- switch(ssrc.getAttribute('direction')) {
|
|
635
|
+ switch (ssrc.getAttribute('direction')) {
|
627
|
636
|
case 'sendrecv':
|
628
|
637
|
el.show();
|
629
|
638
|
break;
|
|
@@ -650,27 +659,24 @@ $(document).bind('passwordrequired.muc', function (event, jid) {
|
650
|
659
|
console.log('on password required', jid);
|
651
|
660
|
|
652
|
661
|
$.prompt('<h2>Password required</h2>' +
|
653
|
|
- '<input id="lockKey" type="text" placeholder="shared key" autofocus>',
|
654
|
|
- {
|
655
|
|
- persistent: true,
|
656
|
|
- buttons: { "Ok": true , "Cancel": false},
|
657
|
|
- defaultButton: 1,
|
658
|
|
- loaded: function(event) {
|
659
|
|
- document.getElementById('lockKey').focus();
|
660
|
|
- },
|
661
|
|
- submit: function(e,v,m,f){
|
662
|
|
- if(v)
|
663
|
|
- {
|
664
|
|
- var lockKey = document.getElementById('lockKey');
|
|
662
|
+ '<input id="lockKey" type="text" placeholder="shared key" autofocus>', {
|
|
663
|
+ persistent: true,
|
|
664
|
+ buttons: { "Ok": true, "Cancel": false},
|
|
665
|
+ defaultButton: 1,
|
|
666
|
+ loaded: function (event) {
|
|
667
|
+ document.getElementById('lockKey').focus();
|
|
668
|
+ },
|
|
669
|
+ submit: function (e, v, m, f) {
|
|
670
|
+ if (v) {
|
|
671
|
+ var lockKey = document.getElementById('lockKey');
|
665
|
672
|
|
666
|
|
- if (lockKey.value !== null)
|
667
|
|
- {
|
668
|
|
- setSharedKey(lockKey.value);
|
669
|
|
- connection.emuc.doJoin(jid, lockKey.value);
|
670
|
|
- }
|
671
|
|
- }
|
|
673
|
+ if (lockKey.value !== null) {
|
|
674
|
+ setSharedKey(lockKey.value);
|
|
675
|
+ connection.emuc.doJoin(jid, lockKey.value);
|
672
|
676
|
}
|
673
|
|
- });
|
|
677
|
+ }
|
|
678
|
+ }
|
|
679
|
+ });
|
674
|
680
|
});
|
675
|
681
|
|
676
|
682
|
$(document).bind('audiomuted.muc', function (event, jid, isMuted) {
|
|
@@ -739,19 +745,19 @@ function updateLargeVideo(newSrc, vol) {
|
739
|
745
|
* @param videoSrc eg. blob:https%3A//pawel.jitsi.net/9a46e0bd-131e-4d18-9c14-a9264e8db395
|
740
|
746
|
* @returns {boolean}
|
741
|
747
|
*/
|
742
|
|
-function isVideoSrcDesktop(videoSrc){
|
|
748
|
+function isVideoSrcDesktop(videoSrc) {
|
743
|
749
|
// FIXME: fix this mapping mess...
|
744
|
750
|
// figure out if large video is desktop stream or just a camera
|
745
|
751
|
var isDesktop = false;
|
746
|
|
- if(localVideoSrc === videoSrc) {
|
|
752
|
+ if (localVideoSrc === videoSrc) {
|
747
|
753
|
// local video
|
748
|
754
|
isDesktop = isUsingScreenStream;
|
749
|
755
|
} else {
|
750
|
756
|
// Do we have associations...
|
751
|
757
|
var videoSsrc = videoSrcToSsrc[videoSrc];
|
752
|
|
- if(videoSsrc) {
|
|
758
|
+ if (videoSsrc) {
|
753
|
759
|
var videoType = ssrc2videoType[videoSsrc];
|
754
|
|
- if(videoType) {
|
|
760
|
+ if (videoType) {
|
755
|
761
|
// Finally there...
|
756
|
762
|
isDesktop = videoType === 'screen';
|
757
|
763
|
} else {
|
|
@@ -769,12 +775,12 @@ function isVideoSrcDesktop(videoSrc){
|
769
|
775
|
*/
|
770
|
776
|
function setLargeVideoVisible(isVisible) {
|
771
|
777
|
if (isVisible) {
|
772
|
|
- $('#largeVideo').css({visibility:'visible'});
|
773
|
|
- $('.watermark').css({visibility:'visible'});
|
|
778
|
+ $('#largeVideo').css({visibility: 'visible'});
|
|
779
|
+ $('.watermark').css({visibility: 'visible'});
|
774
|
780
|
}
|
775
|
781
|
else {
|
776
|
|
- $('#largeVideo').css({visibility:'hidden'});
|
777
|
|
- $('.watermark').css({visibility:'hidden'});
|
|
782
|
+ $('#largeVideo').css({visibility: 'hidden'});
|
|
783
|
+ $('.watermark').css({visibility: 'hidden'});
|
778
|
784
|
}
|
779
|
785
|
}
|
780
|
786
|
|
|
@@ -789,8 +795,8 @@ function toggleVideo() {
|
789
|
795
|
var sess = getConferenceHandler();
|
790
|
796
|
if (sess) {
|
791
|
797
|
sess.toggleVideoMute(
|
792
|
|
- function(isMuted){
|
793
|
|
- if(isMuted) {
|
|
798
|
+ function (isMuted) {
|
|
799
|
+ if (isMuted) {
|
794
|
800
|
$('#video').removeClass("icon-camera");
|
795
|
801
|
$('#video').addClass("icon-camera icon-camera-disabled");
|
796
|
802
|
} else {
|
|
@@ -801,7 +807,7 @@ function toggleVideo() {
|
801
|
807
|
);
|
802
|
808
|
}
|
803
|
809
|
|
804
|
|
- var sess = focus || activecall;
|
|
810
|
+ sess = focus || activecall;
|
805
|
811
|
if (!sess) {
|
806
|
812
|
return;
|
807
|
813
|
}
|
|
@@ -835,30 +841,30 @@ function toggleAudio() {
|
835
|
841
|
* @param videoWidth the stream video width
|
836
|
842
|
* @param videoHeight the stream video height
|
837
|
843
|
*/
|
838
|
|
-var positionLarge = function(videoWidth, videoHeight) {
|
|
844
|
+var positionLarge = function (videoWidth, videoHeight) {
|
839
|
845
|
var videoSpaceWidth = $('#videospace').width();
|
840
|
846
|
var videoSpaceHeight = window.innerHeight;
|
841
|
847
|
|
842
|
|
- var videoSize = getVideoSize( videoWidth,
|
843
|
|
- videoHeight,
|
844
|
|
- videoSpaceWidth,
|
845
|
|
- videoSpaceHeight);
|
|
848
|
+ var videoSize = getVideoSize(videoWidth,
|
|
849
|
+ videoHeight,
|
|
850
|
+ videoSpaceWidth,
|
|
851
|
+ videoSpaceHeight);
|
846
|
852
|
|
847
|
853
|
var largeVideoWidth = videoSize[0];
|
848
|
854
|
var largeVideoHeight = videoSize[1];
|
849
|
855
|
|
850
|
|
- var videoPosition = getVideoPosition( largeVideoWidth,
|
851
|
|
- largeVideoHeight,
|
852
|
|
- videoSpaceWidth,
|
853
|
|
- videoSpaceHeight);
|
|
856
|
+ var videoPosition = getVideoPosition(largeVideoWidth,
|
|
857
|
+ largeVideoHeight,
|
|
858
|
+ videoSpaceWidth,
|
|
859
|
+ videoSpaceHeight);
|
854
|
860
|
|
855
|
861
|
var horizontalIndent = videoPosition[0];
|
856
|
862
|
var verticalIndent = videoPosition[1];
|
857
|
863
|
|
858
|
|
- positionVideo( $('#largeVideo'),
|
859
|
|
- largeVideoWidth,
|
860
|
|
- largeVideoHeight,
|
861
|
|
- horizontalIndent, verticalIndent);
|
|
864
|
+ positionVideo($('#largeVideo'),
|
|
865
|
+ largeVideoWidth,
|
|
866
|
+ largeVideoHeight,
|
|
867
|
+ horizontalIndent, verticalIndent);
|
862
|
868
|
};
|
863
|
869
|
|
864
|
870
|
/**
|
|
@@ -868,21 +874,21 @@ var positionLarge = function(videoWidth, videoHeight) {
|
868
|
874
|
* @return an array with 2 elements, the horizontal indent and the vertical
|
869
|
875
|
* indent
|
870
|
876
|
*/
|
871
|
|
-function getCameraVideoPosition( videoWidth,
|
872
|
|
- videoHeight,
|
873
|
|
- videoSpaceWidth,
|
874
|
|
- videoSpaceHeight) {
|
|
877
|
+function getCameraVideoPosition(videoWidth,
|
|
878
|
+ videoHeight,
|
|
879
|
+ videoSpaceWidth,
|
|
880
|
+ videoSpaceHeight) {
|
875
|
881
|
// Parent height isn't completely calculated when we position the video in
|
876
|
882
|
// full screen mode and this is why we use the screen height in this case.
|
877
|
883
|
// Need to think it further at some point and implement it properly.
|
878
|
|
- var isFullScreen = document.fullScreen
|
879
|
|
- || document.mozFullScreen
|
880
|
|
- || document.webkitIsFullScreen;
|
|
884
|
+ var isFullScreen = document.fullScreen ||
|
|
885
|
+ document.mozFullScreen ||
|
|
886
|
+ document.webkitIsFullScreen;
|
881
|
887
|
if (isFullScreen)
|
882
|
888
|
videoSpaceHeight = window.innerHeight;
|
883
|
889
|
|
884
|
|
- var horizontalIndent = (videoSpaceWidth - videoWidth)/2;
|
885
|
|
- var verticalIndent = (videoSpaceHeight - videoHeight)/2;
|
|
890
|
+ var horizontalIndent = (videoSpaceWidth - videoWidth) / 2;
|
|
891
|
+ var verticalIndent = (videoSpaceHeight - videoHeight) / 2;
|
886
|
892
|
|
887
|
893
|
return [horizontalIndent, verticalIndent];
|
888
|
894
|
}
|
|
@@ -894,12 +900,12 @@ function getCameraVideoPosition( videoWidth,
|
894
|
900
|
* @return an array with 2 elements, the horizontal indent and the vertical
|
895
|
901
|
* indent
|
896
|
902
|
*/
|
897
|
|
-function getDesktopVideoPosition( videoWidth,
|
898
|
|
- videoHeight,
|
899
|
|
- videoSpaceWidth,
|
900
|
|
- videoSpaceHeight) {
|
|
903
|
+function getDesktopVideoPosition(videoWidth,
|
|
904
|
+ videoHeight,
|
|
905
|
+ videoSpaceWidth,
|
|
906
|
+ videoSpaceHeight) {
|
901
|
907
|
|
902
|
|
- var horizontalIndent = (videoSpaceWidth - videoWidth)/2;
|
|
908
|
+ var horizontalIndent = (videoSpaceWidth - videoWidth) / 2;
|
903
|
909
|
|
904
|
910
|
var verticalIndent = 0;// Top aligned
|
905
|
911
|
|
|
@@ -928,10 +934,10 @@ function getCameraVideoSize(videoWidth,
|
928
|
934
|
|
929
|
935
|
if (availableWidth / aspectRatio < videoSpaceHeight) {
|
930
|
936
|
availableHeight = videoSpaceHeight;
|
931
|
|
- availableWidth = availableHeight*aspectRatio;
|
|
937
|
+ availableWidth = availableHeight * aspectRatio;
|
932
|
938
|
}
|
933
|
939
|
|
934
|
|
- if (availableHeight*aspectRatio < videoSpaceWidth) {
|
|
940
|
+ if (availableHeight * aspectRatio < videoSpaceWidth) {
|
935
|
941
|
availableWidth = videoSpaceWidth;
|
936
|
942
|
availableHeight = availableWidth / aspectRatio;
|
937
|
943
|
}
|
|
@@ -945,11 +951,10 @@ function getCameraVideoSize(videoWidth,
|
945
|
951
|
*
|
946
|
952
|
* @return an array with 2 elements, the video width and the video height
|
947
|
953
|
*/
|
948
|
|
-function getDesktopVideoSize( videoWidth,
|
949
|
|
- videoHeight,
|
950
|
|
- videoSpaceWidth,
|
951
|
|
- videoSpaceHeight )
|
952
|
|
-{
|
|
954
|
+function getDesktopVideoSize(videoWidth,
|
|
955
|
+ videoHeight,
|
|
956
|
+ videoSpaceWidth,
|
|
957
|
+ videoSpaceHeight) {
|
953
|
958
|
if (!videoWidth)
|
954
|
959
|
videoWidth = currentVideoWidth;
|
955
|
960
|
if (!videoHeight)
|
|
@@ -965,10 +970,10 @@ function getDesktopVideoSize( videoWidth,
|
965
|
970
|
if (availableWidth / aspectRatio >= videoSpaceHeight)
|
966
|
971
|
{
|
967
|
972
|
availableHeight = videoSpaceHeight;
|
968
|
|
- availableWidth = availableHeight*aspectRatio;
|
|
973
|
+ availableWidth = availableHeight * aspectRatio;
|
969
|
974
|
}
|
970
|
975
|
|
971
|
|
- if (availableHeight*aspectRatio >= videoSpaceWidth)
|
|
976
|
+ if (availableHeight * aspectRatio >= videoSpaceWidth)
|
972
|
977
|
{
|
973
|
978
|
availableWidth = videoSpaceWidth;
|
974
|
979
|
availableHeight = availableWidth / aspectRatio;
|
|
@@ -986,11 +991,11 @@ function getDesktopVideoSize( videoWidth,
|
986
|
991
|
* @param horizontalIndent the left and right indent
|
987
|
992
|
* @param verticalIndent the top and bottom indent
|
988
|
993
|
*/
|
989
|
|
-function positionVideo( video,
|
990
|
|
- width,
|
991
|
|
- height,
|
992
|
|
- horizontalIndent,
|
993
|
|
- verticalIndent) {
|
|
994
|
+function positionVideo(video,
|
|
995
|
+ width,
|
|
996
|
+ height,
|
|
997
|
+ horizontalIndent,
|
|
998
|
+ verticalIndent) {
|
994
|
999
|
video.width(width);
|
995
|
1000
|
video.height(height);
|
996
|
1001
|
video.css({ top: verticalIndent + 'px',
|
|
@@ -1014,7 +1019,7 @@ var resizeLargeVideoContainer = function () {
|
1014
|
1019
|
resizeThumbnails();
|
1015
|
1020
|
};
|
1016
|
1021
|
|
1017
|
|
-var calculateThumbnailSize = function() {
|
|
1022
|
+var calculateThumbnailSize = function () {
|
1018
|
1023
|
// Calculate the available height, which is the inner window height minus
|
1019
|
1024
|
// 39px for the header minus 2px for the delimiter lines on the top and
|
1020
|
1025
|
// bottom of the large video, minus the 36px space inside the remoteVideos
|
|
@@ -1056,8 +1061,7 @@ $(document).ready(function () {
|
1056
|
1061
|
// Set default desktop sharing method
|
1057
|
1062
|
setDesktopSharing(config.desktopSharing);
|
1058
|
1063
|
// Initialize Chrome extension inline installs
|
1059
|
|
- if(config.chromeExtensionId)
|
1060
|
|
- {
|
|
1064
|
+ if (config.chromeExtensionId) {
|
1061
|
1065
|
initInlineInstalls();
|
1062
|
1066
|
}
|
1063
|
1067
|
|
|
@@ -1072,7 +1076,7 @@ $(document).ready(function () {
|
1072
|
1076
|
});
|
1073
|
1077
|
// Listen for large video size updates
|
1074
|
1078
|
document.getElementById('largeVideo')
|
1075
|
|
- .addEventListener('loadedmetadata', function(e){
|
|
1079
|
+ .addEventListener('loadedmetadata', function (e) {
|
1076
|
1080
|
currentVideoWidth = this.videoWidth;
|
1077
|
1081
|
currentVideoHeight = this.videoHeight;
|
1078
|
1082
|
positionLarge(currentVideoWidth, currentVideoHeight);
|
|
@@ -1114,12 +1118,12 @@ $(window).bind('beforeunload', function () {
|
1114
|
1118
|
|
1115
|
1119
|
function disposeConference() {
|
1116
|
1120
|
var handler = getConferenceHandler();
|
1117
|
|
- if(handler && handler.peerconnection) {
|
|
1121
|
+ if (handler && handler.peerconnection) {
|
1118
|
1122
|
// FIXME: probably removing streams is not required and close() should be enough
|
1119
|
|
- if(connection.jingle.localAudio) {
|
|
1123
|
+ if (connection.jingle.localAudio) {
|
1120
|
1124
|
handler.peerconnection.removeStream(connection.jingle.localAudio);
|
1121
|
1125
|
}
|
1122
|
|
- if(connection.jingle.localVideo) {
|
|
1126
|
+ if (connection.jingle.localVideo) {
|
1123
|
1127
|
handler.peerconnection.removeStream(connection.jingle.localVideo);
|
1124
|
1128
|
}
|
1125
|
1129
|
handler.peerconnection.close();
|
|
@@ -1128,7 +1132,7 @@ function disposeConference() {
|
1128
|
1132
|
activecall = null;
|
1129
|
1133
|
}
|
1130
|
1134
|
|
1131
|
|
-function dump(elem, filename){
|
|
1135
|
+function dump(elem, filename) {
|
1132
|
1136
|
elem = elem.parentNode;
|
1133
|
1137
|
elem.download = filename || 'meetlog.json';
|
1134
|
1138
|
elem.href = 'data:application/json;charset=utf-8,\n';
|
|
@@ -1141,8 +1145,8 @@ function dump(elem, filename){
|
1141
|
1145
|
data["jingle_" + session.sid] = {
|
1142
|
1146
|
updateLog: session.peerconnection.updateLog,
|
1143
|
1147
|
stats: session.peerconnection.stats,
|
1144
|
|
- url: window.location.href}
|
1145
|
|
- ;
|
|
1148
|
+ url: window.location.href
|
|
1149
|
+ };
|
1146
|
1150
|
}
|
1147
|
1151
|
});
|
1148
|
1152
|
}
|
|
@@ -1173,56 +1177,57 @@ function openLockDialog() {
|
1173
|
1177
|
if (focus === null) {
|
1174
|
1178
|
if (sharedKey)
|
1175
|
1179
|
$.prompt("This conversation is currently protected by a shared secret key.",
|
1176
|
|
- {
|
1177
|
|
- title: "Secrect key",
|
1178
|
|
- persistent: false
|
1179
|
|
- });
|
|
1180
|
+ {
|
|
1181
|
+ title: "Secrect key",
|
|
1182
|
+ persistent: false
|
|
1183
|
+ }
|
|
1184
|
+ );
|
1180
|
1185
|
else
|
1181
|
1186
|
$.prompt("This conversation isn't currently protected by a secret key. Only the owner of the conference could set a shared key.",
|
1182
|
|
- {
|
1183
|
|
- title: "Secrect key",
|
1184
|
|
- persistent: false
|
1185
|
|
- });
|
1186
|
|
- }
|
1187
|
|
- else {
|
1188
|
|
- if (sharedKey)
|
|
1187
|
+ {
|
|
1188
|
+ title: "Secrect key",
|
|
1189
|
+ persistent: false
|
|
1190
|
+ }
|
|
1191
|
+ );
|
|
1192
|
+ } else {
|
|
1193
|
+ if (sharedKey) {
|
1189
|
1194
|
$.prompt("Are you sure you would like to remove your secret key?",
|
1190
|
|
- {
|
1191
|
|
- title: "Remove secrect key",
|
1192
|
|
- persistent: false,
|
1193
|
|
- buttons: { "Remove": true, "Cancel": false},
|
1194
|
|
- defaultButton: 1,
|
1195
|
|
- submit: function(e,v,m,f){
|
1196
|
|
- if(v)
|
1197
|
|
- {
|
1198
|
|
- setSharedKey('');
|
1199
|
|
- lockRoom(false);
|
1200
|
|
- }
|
1201
|
|
- }
|
1202
|
|
- });
|
1203
|
|
- else
|
|
1195
|
+ {
|
|
1196
|
+ title: "Remove secrect key",
|
|
1197
|
+ persistent: false,
|
|
1198
|
+ buttons: { "Remove": true, "Cancel": false},
|
|
1199
|
+ defaultButton: 1,
|
|
1200
|
+ submit: function (e, v, m, f) {
|
|
1201
|
+ if (v) {
|
|
1202
|
+ setSharedKey('');
|
|
1203
|
+ lockRoom(false);
|
|
1204
|
+ }
|
|
1205
|
+ }
|
|
1206
|
+ }
|
|
1207
|
+ );
|
|
1208
|
+ } else {
|
1204
|
1209
|
$.prompt('<h2>Set a secrect key to lock your room</h2>' +
|
1205
|
1210
|
'<input id="lockKey" type="text" placeholder="your shared key" autofocus>',
|
1206
|
|
- {
|
1207
|
|
- persistent: false,
|
1208
|
|
- buttons: { "Save": true , "Cancel": false},
|
1209
|
|
- defaultButton: 1,
|
1210
|
|
- loaded: function(event) {
|
1211
|
|
- document.getElementById('lockKey').focus();
|
1212
|
|
- },
|
1213
|
|
- submit: function(e,v,m,f){
|
1214
|
|
- if(v)
|
1215
|
|
- {
|
1216
|
|
- var lockKey = document.getElementById('lockKey');
|
1217
|
|
-
|
1218
|
|
- if (lockKey.value)
|
1219
|
|
- {
|
1220
|
|
- setSharedKey(Util.escapeHtml(lockKey.value));
|
1221
|
|
- lockRoom(true);
|
|
1211
|
+ {
|
|
1212
|
+ persistent: false,
|
|
1213
|
+ buttons: { "Save": true, "Cancel": false},
|
|
1214
|
+ defaultButton: 1,
|
|
1215
|
+ loaded: function (event) {
|
|
1216
|
+ document.getElementById('lockKey').focus();
|
|
1217
|
+ },
|
|
1218
|
+ submit: function (e, v, m, f) {
|
|
1219
|
+ if (v) {
|
|
1220
|
+ var lockKey = document.getElementById('lockKey');
|
|
1221
|
+
|
|
1222
|
+ if (lockKey.value) {
|
|
1223
|
+ setSharedKey(Util.escapeHtml(lockKey.value));
|
|
1224
|
+ lockRoom(true);
|
|
1225
|
+ }
|
1222
|
1226
|
}
|
1223
|
|
- }
|
|
1227
|
+ }
|
1224
|
1228
|
}
|
1225
|
|
- });
|
|
1229
|
+ );
|
|
1230
|
+ }
|
1226
|
1231
|
}
|
1227
|
1232
|
}
|
1228
|
1233
|
|
|
@@ -1230,16 +1235,17 @@ function openLockDialog() {
|
1230
|
1235
|
* Opens the invite link dialog.
|
1231
|
1236
|
*/
|
1232
|
1237
|
function openLinkDialog() {
|
1233
|
|
- $.prompt('<input id="inviteLinkRef" type="text" value="'
|
1234
|
|
- + encodeURI(roomUrl) + '" onclick="this.select();" readonly>',
|
1235
|
|
- {
|
1236
|
|
- title: "Share this link with everyone you want to invite",
|
1237
|
|
- persistent: false,
|
1238
|
|
- buttons: { "Cancel": false},
|
1239
|
|
- loaded: function(event) {
|
1240
|
|
- document.getElementById('inviteLinkRef').select();
|
1241
|
|
- }
|
1242
|
|
- });
|
|
1238
|
+ $.prompt('<input id="inviteLinkRef" type="text" value="' +
|
|
1239
|
+ encodeURI(roomUrl) + '" onclick="this.select();" readonly>',
|
|
1240
|
+ {
|
|
1241
|
+ title: "Share this link with everyone you want to invite",
|
|
1242
|
+ persistent: false,
|
|
1243
|
+ buttons: { "Cancel": false},
|
|
1244
|
+ loaded: function (event) {
|
|
1245
|
+ document.getElementById('inviteLinkRef').select();
|
|
1246
|
+ }
|
|
1247
|
+ }
|
|
1248
|
+ );
|
1243
|
1249
|
}
|
1244
|
1250
|
|
1245
|
1251
|
/**
|
|
@@ -1247,40 +1253,38 @@ function openLinkDialog() {
|
1247
|
1253
|
*/
|
1248
|
1254
|
function openSettingsDialog() {
|
1249
|
1255
|
$.prompt('<h2>Configure your conference</h2>' +
|
1250
|
|
- '<input type="checkbox" id="initMuted"> Participants join muted<br/>' +
|
1251
|
|
- '<input type="checkbox" id="requireNicknames"> Require nicknames<br/><br/>' +
|
1252
|
|
- 'Set a secrect key to lock your room: <input id="lockKey" type="text" placeholder="your shared key" autofocus>',
|
1253
|
|
- {
|
1254
|
|
- persistent: false,
|
1255
|
|
- buttons: { "Save": true , "Cancel": false},
|
1256
|
|
- defaultButton: 1,
|
1257
|
|
- loaded: function(event) {
|
1258
|
|
- document.getElementById('lockKey').focus();
|
1259
|
|
- },
|
1260
|
|
- submit: function(e,v,m,f){
|
1261
|
|
- if(v)
|
1262
|
|
- {
|
1263
|
|
- if ($('#initMuted').is(":checked"))
|
1264
|
|
- {
|
1265
|
|
- // it is checked
|
1266
|
|
- }
|
|
1256
|
+ '<input type="checkbox" id="initMuted"> Participants join muted<br/>' +
|
|
1257
|
+ '<input type="checkbox" id="requireNicknames"> Require nicknames<br/><br/>' +
|
|
1258
|
+ 'Set a secrect key to lock your room: <input id="lockKey" type="text" placeholder="your shared key" autofocus>',
|
|
1259
|
+ {
|
|
1260
|
+ persistent: false,
|
|
1261
|
+ buttons: { "Save": true, "Cancel": false},
|
|
1262
|
+ defaultButton: 1,
|
|
1263
|
+ loaded: function (event) {
|
|
1264
|
+ document.getElementById('lockKey').focus();
|
|
1265
|
+ },
|
|
1266
|
+ submit: function (e, v, m, f) {
|
|
1267
|
+ if (v) {
|
|
1268
|
+ if ($('#initMuted').is(":checked")) {
|
|
1269
|
+ // it is checked
|
|
1270
|
+ }
|
1267
|
1271
|
|
1268
|
|
- if ($('#requireNicknames').is(":checked"))
|
1269
|
|
- {
|
1270
|
|
- // it is checked
|
1271
|
|
- }
|
1272
|
|
- /*
|
1273
|
|
- var lockKey = document.getElementById('lockKey');
|
|
1272
|
+ if ($('#requireNicknames').is(":checked")) {
|
|
1273
|
+ // it is checked
|
|
1274
|
+ }
|
|
1275
|
+ /*
|
|
1276
|
+ var lockKey = document.getElementById('lockKey');
|
1274
|
1277
|
|
1275
|
|
- if (lockKey.value)
|
1276
|
|
- {
|
1277
|
|
- setSharedKey(lockKey.value);
|
1278
|
|
- lockRoom(true);
|
1279
|
|
- }
|
1280
|
|
- */
|
|
1278
|
+ if (lockKey.value)
|
|
1279
|
+ {
|
|
1280
|
+ setSharedKey(lockKey.value);
|
|
1281
|
+ lockRoom(true);
|
1281
|
1282
|
}
|
|
1283
|
+ */
|
1282
|
1284
|
}
|
1283
|
|
- });
|
|
1285
|
+ }
|
|
1286
|
+ }
|
|
1287
|
+ );
|
1284
|
1288
|
}
|
1285
|
1289
|
|
1286
|
1290
|
/**
|
|
@@ -1312,10 +1316,10 @@ function updateLockButton() {
|
1312
|
1316
|
/**
|
1313
|
1317
|
* Hides the toolbar.
|
1314
|
1318
|
*/
|
1315
|
|
-var hideToolbar = function() {
|
|
1319
|
+var hideToolbar = function () {
|
1316
|
1320
|
|
1317
|
1321
|
var isToolbarHover = false;
|
1318
|
|
- $('#header').find('*').each(function(){
|
|
1322
|
+ $('#header').find('*').each(function () {
|
1319
|
1323
|
var id = $(this).attr('id');
|
1320
|
1324
|
if ($("#" + id + ":hover").length > 0) {
|
1321
|
1325
|
isToolbarHover = true;
|
|
@@ -1418,7 +1422,7 @@ function showFocusIndicator() {
|
1418
|
1422
|
var session = connection.jingle.sessions[Object.keys(connection.jingle.sessions)[0]];
|
1419
|
1423
|
var focusId = 'participant_' + Strophe.getResourceFromJid(session.peerjid);
|
1420
|
1424
|
var focusContainer = document.getElementById(focusId);
|
1421
|
|
- if(!focusContainer) {
|
|
1425
|
+ if (!focusContainer) {
|
1422
|
1426
|
console.error("No focus container!");
|
1423
|
1427
|
return;
|
1424
|
1428
|
}
|
|
@@ -1438,12 +1442,11 @@ function showFocusIndicator() {
|
1438
|
1442
|
* Checks if container for participant identified by given peerJid exists in the document and creates it eventually.
|
1439
|
1443
|
* @param peerJid peer Jid to check.
|
1440
|
1444
|
*/
|
1441
|
|
-function ensurePeerContainerExists(peerJid){
|
1442
|
|
-
|
|
1445
|
+function ensurePeerContainerExists(peerJid) {
|
1443
|
1446
|
var peerResource = Strophe.getResourceFromJid(peerJid);
|
1444
|
1447
|
var videoSpanId = 'participant_' + peerResource;
|
1445
|
1448
|
|
1446
|
|
- if($('#'+videoSpanId).length > 0) {
|
|
1449
|
+ if ($('#' + videoSpanId).length > 0) {
|
1447
|
1450
|
return;
|
1448
|
1451
|
}
|
1449
|
1452
|
|
|
@@ -1482,8 +1485,7 @@ function createFocusIndicatorElement(parentElement) {
|
1482
|
1485
|
function toggleFullScreen() {
|
1483
|
1486
|
var fsElement = document.documentElement;
|
1484
|
1487
|
|
1485
|
|
- if (!document.mozFullScreen && !document.webkitIsFullScreen){
|
1486
|
|
-
|
|
1488
|
+ if (!document.mozFullScreen && !document.webkitIsFullScreen) {
|
1487
|
1489
|
//Enter Full Screen
|
1488
|
1490
|
if (fsElement.mozRequestFullScreen) {
|
1489
|
1491
|
fsElement.mozRequestFullScreen();
|
|
@@ -1511,13 +1513,13 @@ function showDisplayName(videoSpanId, displayName) {
|
1511
|
1513
|
if (nameSpan.length > 0) {
|
1512
|
1514
|
var nameSpanElement = nameSpan.get(0);
|
1513
|
1515
|
|
1514
|
|
- if (nameSpanElement.id === 'localDisplayName'
|
1515
|
|
- && $('#localDisplayName').text() !== displayName)
|
|
1516
|
+ if (nameSpanElement.id === 'localDisplayName' &&
|
|
1517
|
+ $('#localDisplayName').text() !== displayName) {
|
1516
|
1518
|
$('#localDisplayName').text(displayName);
|
1517
|
|
- else
|
|
1519
|
+ } else {
|
1518
|
1520
|
$('#' + videoSpanId + '_name').text(displayName);
|
1519
|
|
- }
|
1520
|
|
- else {
|
|
1521
|
+ }
|
|
1522
|
+ } else {
|
1521
|
1523
|
var editButton = null;
|
1522
|
1524
|
|
1523
|
1525
|
if (videoSpanId === 'localVideoContainer') {
|
|
@@ -1532,8 +1534,7 @@ function showDisplayName(videoSpanId, displayName) {
|
1532
|
1534
|
|
1533
|
1535
|
if (!editButton) {
|
1534
|
1536
|
nameSpan.id = videoSpanId + '_name';
|
1535
|
|
- }
|
1536
|
|
- else {
|
|
1537
|
+ } else {
|
1537
|
1538
|
nameSpan.id = 'localDisplayName';
|
1538
|
1539
|
$('#' + videoSpanId)[0].appendChild(editButton);
|
1539
|
1540
|
|
|
@@ -1541,22 +1542,22 @@ function showDisplayName(videoSpanId, displayName) {
|
1541
|
1542
|
editableText.className = 'displayname';
|
1542
|
1543
|
editableText.id = 'editDisplayName';
|
1543
|
1544
|
|
1544
|
|
- if (displayName.length)
|
1545
|
|
- editableText.value
|
1546
|
|
- = displayName.substring(0, displayName.indexOf(' (me)'));
|
|
1545
|
+ if (displayName.length) {
|
|
1546
|
+ editableText.value = displayName.substring(0, displayName.indexOf(' (me)'));
|
|
1547
|
+ }
|
1547
|
1548
|
|
1548
|
1549
|
editableText.setAttribute('style', 'display:none;');
|
1549
|
1550
|
editableText.setAttribute('placeholder', 'ex. Jane Pink');
|
1550
|
1551
|
$('#' + videoSpanId)[0].appendChild(editableText);
|
1551
|
1552
|
|
1552
|
|
- $('#localVideoContainer .displayname').bind("click", function(e) {
|
|
1553
|
+ $('#localVideoContainer .displayname').bind("click", function (e) {
|
1553
|
1554
|
e.preventDefault();
|
1554
|
1555
|
$('#localDisplayName').hide();
|
1555
|
1556
|
$('#editDisplayName').show();
|
1556
|
1557
|
$('#editDisplayName').focus();
|
1557
|
1558
|
$('#editDisplayName').select();
|
1558
|
1559
|
|
1559
|
|
- var inputDisplayNameHandler = function(name) {
|
|
1560
|
+ var inputDisplayNameHandler = function (name) {
|
1560
|
1561
|
if (nickname !== name) {
|
1561
|
1562
|
nickname = name;
|
1562
|
1563
|
window.localStorage.displayname = nickname;
|
|
@@ -1661,20 +1662,21 @@ function showVideoIndicator(videoSpanId, isMuted) {
|
1661
|
1662
|
* Resizes and repositions videos in full screen mode.
|
1662
|
1663
|
*/
|
1663
|
1664
|
$(document).on('webkitfullscreenchange mozfullscreenchange fullscreenchange',
|
1664
|
|
- function() {
|
1665
|
|
- resizeLargeVideoContainer();
|
1666
|
|
- positionLarge();
|
1667
|
|
- isFullScreen = document.fullScreen
|
1668
|
|
- || document.mozFullScreen
|
1669
|
|
- || document.webkitIsFullScreen;
|
1670
|
|
-
|
1671
|
|
- if (isFullScreen) {
|
1672
|
|
- setView("fullscreen");
|
1673
|
|
- }
|
1674
|
|
- else {
|
1675
|
|
- setView("default");
|
1676
|
|
- }
|
1677
|
|
-});
|
|
1665
|
+ function () {
|
|
1666
|
+ resizeLargeVideoContainer();
|
|
1667
|
+ positionLarge();
|
|
1668
|
+ isFullScreen = document.fullScreen ||
|
|
1669
|
+ document.mozFullScreen ||
|
|
1670
|
+ document.webkitIsFullScreen;
|
|
1671
|
+
|
|
1672
|
+ if (isFullScreen) {
|
|
1673
|
+ setView("fullscreen");
|
|
1674
|
+ }
|
|
1675
|
+ else {
|
|
1676
|
+ setView("default");
|
|
1677
|
+ }
|
|
1678
|
+ }
|
|
1679
|
+);
|
1678
|
1680
|
|
1679
|
1681
|
/**
|
1680
|
1682
|
* Sets the current view.
|