|
@@ -1,6 +1,6 @@
|
1
|
1
|
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.JitsiMeetJS = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
2
|
2
|
(function (__filename){
|
3
|
|
-/* global Strophe, $ */
|
|
3
|
+/* global Strophe, $, Promise */
|
4
|
4
|
/* jshint -W101 */
|
5
|
5
|
var logger = require("jitsi-meet-logger").getLogger(__filename);
|
6
|
6
|
var RTC = require("./modules/RTC/RTC");
|
|
@@ -54,6 +54,13 @@ JitsiConference.prototype.join = function (password) {
|
54
|
54
|
this.room.join(password, this.connection.tokenPassword);
|
55
|
55
|
};
|
56
|
56
|
|
|
57
|
+/**
|
|
58
|
+ * Check if joined to the conference.
|
|
59
|
+ */
|
|
60
|
+JitsiConference.prototype.isJoined = function () {
|
|
61
|
+ return this.room && this.room.joined;
|
|
62
|
+};
|
|
63
|
+
|
57
|
64
|
/**
|
58
|
65
|
* Leaves the conference.
|
59
|
66
|
*/
|
|
@@ -63,6 +70,40 @@ JitsiConference.prototype.leave = function () {
|
63
|
70
|
this.room = null;
|
64
|
71
|
};
|
65
|
72
|
|
|
73
|
+/**
|
|
74
|
+ * Returns name of this conference.
|
|
75
|
+ */
|
|
76
|
+JitsiConference.prototype.getName = function () {
|
|
77
|
+ return this.options.name;
|
|
78
|
+};
|
|
79
|
+
|
|
80
|
+/**
|
|
81
|
+ * Check if external authentication is enabled for this conference.
|
|
82
|
+ */
|
|
83
|
+JitsiConference.prototype.isExternalAuthEnabled = function () {
|
|
84
|
+ return this.room && this.room.moderator.isExternalAuthEnabled();
|
|
85
|
+};
|
|
86
|
+
|
|
87
|
+/**
|
|
88
|
+ * Get url for external authentication.
|
|
89
|
+ * @param {boolean} [urlForPopup] if true then return url for login popup,
|
|
90
|
+ * else url of login page.
|
|
91
|
+ * @returns {Promise}
|
|
92
|
+ */
|
|
93
|
+JitsiConference.prototype.getExternalAuthUrl = function (urlForPopup) {
|
|
94
|
+ return new Promise(function (resolve, reject) {
|
|
95
|
+ if (!this.isExternalAuthEnabled()) {
|
|
96
|
+ reject();
|
|
97
|
+ return;
|
|
98
|
+ }
|
|
99
|
+ if (urlForPopup) {
|
|
100
|
+ this.room.moderator.getPopupLoginUrl(resolve, reject);
|
|
101
|
+ } else {
|
|
102
|
+ this.room.moderator.getLoginUrl(resolve, reject);
|
|
103
|
+ }
|
|
104
|
+ }.bind(this));
|
|
105
|
+};
|
|
106
|
+
|
66
|
107
|
/**
|
67
|
108
|
* Returns the local tracks.
|
68
|
109
|
*/
|
|
@@ -225,6 +266,11 @@ JitsiConference.prototype._fireMuteChangeEvent = function (track) {
|
225
|
266
|
* @param track the JitsiLocalTrack object.
|
226
|
267
|
*/
|
227
|
268
|
JitsiConference.prototype.removeTrack = function (track) {
|
|
269
|
+ if(!this.room){
|
|
270
|
+ if(this.rtc)
|
|
271
|
+ this.rtc.removeLocalStream(track);
|
|
272
|
+ return;
|
|
273
|
+ }
|
228
|
274
|
this.room.removeStream(track.getOriginalStream(), function(){
|
229
|
275
|
this.rtc.removeLocalStream(track);
|
230
|
276
|
this.eventEmitter.emit(JitsiConferenceEvents.TRACK_REMOVED, track);
|
|
@@ -264,7 +310,7 @@ JitsiConference.prototype.lock = function (password) {
|
264
|
310
|
}, function (err) {
|
265
|
311
|
reject(err);
|
266
|
312
|
}, function () {
|
267
|
|
- reject(JitsiConferenceErrors.PASSWORD_REQUIRED);
|
|
313
|
+ reject(JitsiConferenceErrors.PASSWORD_NOT_SUPPORTED);
|
268
|
314
|
});
|
269
|
315
|
});
|
270
|
316
|
};
|
|
@@ -475,6 +521,18 @@ function setupListeners(conference) {
|
475
|
521
|
conference.room.addListener(XMPPEvents.MUC_JOINED, function () {
|
476
|
522
|
conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_JOINED);
|
477
|
523
|
});
|
|
524
|
+ conference.room.addListener(XMPPEvents.ROOM_JOIN_ERROR, function (pres) {
|
|
525
|
+ conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED, JitsiConferenceErrors.CONNECTION_ERROR, pres);
|
|
526
|
+ });
|
|
527
|
+ conference.room.addListener(XMPPEvents.ROOM_CONNECT_ERROR, function (pres) {
|
|
528
|
+ conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED, JitsiConferenceErrors.CONNECTION_ERROR, pres);
|
|
529
|
+ });
|
|
530
|
+ conference.room.addListener(XMPPEvents.PASSWORD_REQUIRED, function (pres) {
|
|
531
|
+ conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED, JitsiConferenceErrors.PASSWORD_REQUIRED, pres);
|
|
532
|
+ });
|
|
533
|
+ conference.room.addListener(XMPPEvents.AUTHENTICATION_REQUIRED, function () {
|
|
534
|
+ conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED, JitsiConferenceErrors.AUTHENTICATION_REQUIRED);
|
|
535
|
+ });
|
478
|
536
|
// FIXME
|
479
|
537
|
// conference.room.addListener(XMPPEvents.MUC_JOINED, function () {
|
480
|
538
|
// conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_LEFT);
|
|
@@ -498,7 +556,7 @@ function setupListeners(conference) {
|
498
|
556
|
conference.eventEmitter.emit(JitsiConferenceEvents.CONNECTION_RESTORED);
|
499
|
557
|
});
|
500
|
558
|
conference.room.addListener(XMPPEvents.CONFERENCE_SETUP_FAILED, function () {
|
501
|
|
- conference.eventEmitter.emit(JitsiConferenceEvents.SETUP_FAILED);
|
|
559
|
+ conference.eventEmitter.emit(JitsiConferenceEvents.CONFERENCE_FAILED, JitsiConferenceErrors.SETUP_FAILED);
|
502
|
560
|
});
|
503
|
561
|
|
504
|
562
|
conference.room.addListener(XMPPEvents.MESSAGE_RECEIVED, function (jid, displayName, txt, myJid, ts) {
|
|
@@ -561,6 +619,10 @@ var JitsiConferenceErrors = {
|
561
|
619
|
* Indicates that a password is required in order to join the conference.
|
562
|
620
|
*/
|
563
|
621
|
PASSWORD_REQUIRED: "conference.passwordRequired",
|
|
622
|
+ /**
|
|
623
|
+ * Indicates that client must be authenticated to create the conference.
|
|
624
|
+ */
|
|
625
|
+ AUTHENTICATION_REQUIRED: "conference.authenticationRequired",
|
564
|
626
|
/**
|
565
|
627
|
* Indicates that password cannot be set for this conference.
|
566
|
628
|
*/
|
|
@@ -570,6 +632,10 @@ var JitsiConferenceErrors = {
|
570
|
632
|
* conference.
|
571
|
633
|
*/
|
572
|
634
|
CONNECTION_ERROR: "conference.connectionError",
|
|
635
|
+ /**
|
|
636
|
+ * Indicates that the conference setup failed.
|
|
637
|
+ */
|
|
638
|
+ SETUP_FAILED: "conference.setup_failed",
|
573
|
639
|
/**
|
574
|
640
|
* Indicates that there is no available videobridge.
|
575
|
641
|
*/
|
|
@@ -653,9 +719,9 @@ var JitsiConferenceEvents = {
|
653
|
719
|
*/
|
654
|
720
|
CONNECTION_RESTORED: "conference.connectionRestored",
|
655
|
721
|
/**
|
656
|
|
- * Indicates that the conference setup failed.
|
|
722
|
+ * Indicates that conference failed.
|
657
|
723
|
*/
|
658
|
|
- SETUP_FAILED: "conference.setup_failed",
|
|
724
|
+ CONFERENCE_FAILED: "conference.failed",
|
659
|
725
|
/**
|
660
|
726
|
* Indicates that conference has been joined.
|
661
|
727
|
*/
|
|
@@ -1346,7 +1412,6 @@ function JitsiLocalTrack(stream, videoType,
|
1346
|
1412
|
this.dontFireRemoveEvent = false;
|
1347
|
1413
|
this.resolution = resolution;
|
1348
|
1414
|
this.startMuted = false;
|
1349
|
|
- this.isLocal = true;
|
1350
|
1415
|
var self = this;
|
1351
|
1416
|
JitsiTrack.call(this, null, stream,
|
1352
|
1417
|
function () {
|
|
@@ -1517,7 +1582,6 @@ function JitsiRemoteTrack(RTC, data, sid, ssrc) {
|
1517
|
1582
|
this.videoType = data.videoType;
|
1518
|
1583
|
this.ssrc = ssrc;
|
1519
|
1584
|
this.muted = false;
|
1520
|
|
- this.isLocal = false;
|
1521
|
1585
|
if((this.type === JitsiTrack.AUDIO && data.audiomuted)
|
1522
|
1586
|
|| (this.type === JitsiTrack.VIDEO && data.videomuted)) {
|
1523
|
1587
|
this.muted = true;
|
|
@@ -3391,9 +3455,8 @@ module.exports = ScreenObtainer;
|
3391
|
3455
|
}).call(this,"/modules/RTC/ScreenObtainer.js")
|
3392
|
3456
|
},{"../../service/desktopsharing/DesktopSharingEventTypes":82,"./RTCBrowserType":17,"./adapter.screenshare":20,"jitsi-meet-logger":47}],20:[function(require,module,exports){
|
3393
|
3457
|
(function (__filename){
|
3394
|
|
-/*! adapterjs - v0.12.0 - 2015-09-04 */
|
|
3458
|
+/*! adapterjs - v0.12.3 - 2015-11-16 */
|
3395
|
3459
|
var console = require("jitsi-meet-logger").getLogger(__filename);
|
3396
|
|
-
|
3397
|
3460
|
// Adapter's interface.
|
3398
|
3461
|
var AdapterJS = AdapterJS || {};
|
3399
|
3462
|
|
|
@@ -3411,7 +3474,7 @@ AdapterJS.options = AdapterJS.options || {};
|
3411
|
3474
|
// AdapterJS.options.hidePluginInstallPrompt = true;
|
3412
|
3475
|
|
3413
|
3476
|
// AdapterJS version
|
3414
|
|
-AdapterJS.VERSION = '0.12.0';
|
|
3477
|
+AdapterJS.VERSION = '0.12.3';
|
3415
|
3478
|
|
3416
|
3479
|
// This function will be called when the WebRTC API is ready to be used
|
3417
|
3480
|
// Whether it is the native implementation (Chrome, Firefox, Opera) or
|
|
@@ -4001,7 +4064,7 @@ if (navigator.mozGetUserMedia) {
|
4001
|
4064
|
|
4002
|
4065
|
createIceServers = function (urls, username, password) {
|
4003
|
4066
|
var iceServers = [];
|
4004
|
|
- for (i = 0; i < urls.length; i++) {
|
|
4067
|
+ for (var i = 0; i < urls.length; i++) {
|
4005
|
4068
|
var iceServer = createIceServer(urls[i], username, password);
|
4006
|
4069
|
if (iceServer !== null) {
|
4007
|
4070
|
iceServers.push(iceServer);
|
|
@@ -4091,7 +4154,7 @@ if (navigator.mozGetUserMedia) {
|
4091
|
4154
|
'username' : username
|
4092
|
4155
|
};
|
4093
|
4156
|
} else {
|
4094
|
|
- for (i = 0; i < urls.length; i++) {
|
|
4157
|
+ for (var i = 0; i < urls.length; i++) {
|
4095
|
4158
|
var iceServer = createIceServer(urls[i], username, password);
|
4096
|
4159
|
if (iceServer !== null) {
|
4097
|
4160
|
iceServers.push(iceServer);
|
|
@@ -4393,12 +4456,13 @@ if (navigator.mozGetUserMedia) {
|
4393
|
4456
|
return;
|
4394
|
4457
|
}
|
4395
|
4458
|
|
4396
|
|
- var streamId
|
|
4459
|
+ var streamId;
|
4397
|
4460
|
if (stream === null) {
|
4398
|
4461
|
streamId = '';
|
4399
|
|
- }
|
4400
|
|
- else {
|
4401
|
|
- stream.enableSoundTracks(true); // TODO: remove on 0.12.0
|
|
4462
|
+ } else {
|
|
4463
|
+ if (typeof stream.enableSoundTracks !== 'undefined') {
|
|
4464
|
+ stream.enableSoundTracks(true);
|
|
4465
|
+ }
|
4402
|
4466
|
streamId = stream.id;
|
4403
|
4467
|
}
|
4404
|
4468
|
|
|
@@ -4440,16 +4504,13 @@ if (navigator.mozGetUserMedia) {
|
4440
|
4504
|
|
4441
|
4505
|
var height = '';
|
4442
|
4506
|
var width = '';
|
4443
|
|
- if (element.getBoundingClientRect) {
|
4444
|
|
- var rectObject = element.getBoundingClientRect();
|
4445
|
|
- width = rectObject.width + 'px';
|
4446
|
|
- height = rectObject.height + 'px';
|
|
4507
|
+ if (element.clientWidth || element.clientHeight) {
|
|
4508
|
+ width = element.clientWidth;
|
|
4509
|
+ height = element.clientHeight;
|
4447
|
4510
|
}
|
4448
|
|
- else if (element.width) {
|
|
4511
|
+ else if (element.width || element.height) {
|
4449
|
4512
|
width = element.width;
|
4450
|
4513
|
height = element.height;
|
4451
|
|
- } else {
|
4452
|
|
- // TODO: What scenario could bring us here?
|
4453
|
4514
|
}
|
4454
|
4515
|
|
4455
|
4516
|
element.parentNode.insertBefore(frag, element);
|
|
@@ -4468,19 +4529,7 @@ if (navigator.mozGetUserMedia) {
|
4468
|
4529
|
element.setStreamId(streamId);
|
4469
|
4530
|
}
|
4470
|
4531
|
var newElement = document.getElementById(elementId);
|
4471
|
|
- newElement.onplaying = (element.onplaying) ? element.onplaying : function (arg) {};
|
4472
|
|
- newElement.onplay = (element.onplay) ? element.onplay : function (arg) {};
|
4473
|
|
- newElement.onclick = (element.onclick) ? element.onclick : function (arg) {};
|
4474
|
|
- if (isIE) { // on IE the event needs to be plugged manually
|
4475
|
|
- newElement.attachEvent('onplaying', newElement.onplaying);
|
4476
|
|
- newElement.attachEvent('onplay', newElement.onplay);
|
4477
|
|
- newElement._TemOnClick = function (id) {
|
4478
|
|
- var arg = {
|
4479
|
|
- srcElement : document.getElementById(id)
|
4480
|
|
- };
|
4481
|
|
- newElement.onclick(arg);
|
4482
|
|
- };
|
4483
|
|
- }
|
|
4532
|
+ AdapterJS.forwardEventHandlers(newElement, element, Object.getPrototypeOf(element));
|
4484
|
4533
|
|
4485
|
4534
|
return newElement;
|
4486
|
4535
|
};
|
|
@@ -4503,6 +4552,32 @@ if (navigator.mozGetUserMedia) {
|
4503
|
4552
|
}
|
4504
|
4553
|
};
|
4505
|
4554
|
|
|
4555
|
+ AdapterJS.forwardEventHandlers = function (destElem, srcElem, prototype) {
|
|
4556
|
+
|
|
4557
|
+ properties = Object.getOwnPropertyNames( prototype );
|
|
4558
|
+
|
|
4559
|
+ for(prop in properties) {
|
|
4560
|
+ propName = properties[prop];
|
|
4561
|
+
|
|
4562
|
+ if (typeof(propName.slice) === 'function') {
|
|
4563
|
+ if (propName.slice(0,2) == 'on' && srcElem[propName] != null) {
|
|
4564
|
+ if (isIE) {
|
|
4565
|
+ destElem.attachEvent(propName,srcElem[propName]);
|
|
4566
|
+ } else {
|
|
4567
|
+ destElem.addEventListener(propName.slice(2), srcElem[propName], false)
|
|
4568
|
+ }
|
|
4569
|
+ } else {
|
|
4570
|
+ //TODO (http://jira.temasys.com.sg/browse/TWP-328) Forward non-event properties ?
|
|
4571
|
+ }
|
|
4572
|
+ }
|
|
4573
|
+ }
|
|
4574
|
+
|
|
4575
|
+ var subPrototype = Object.getPrototypeOf(prototype)
|
|
4576
|
+ if(subPrototype != null) {
|
|
4577
|
+ AdapterJS.forwardEventHandlers(destElem, srcElem, subPrototype);
|
|
4578
|
+ }
|
|
4579
|
+ }
|
|
4580
|
+
|
4506
|
4581
|
RTCIceCandidate = function (candidate) {
|
4507
|
4582
|
if (!candidate.sdpMid) {
|
4508
|
4583
|
candidate.sdpMid = '';
|
|
@@ -9659,7 +9734,7 @@ function TraceablePeerConnection(ice_config, constraints, session) {
|
9659
|
9734
|
var Interop = require('sdp-interop').Interop;
|
9660
|
9735
|
this.interop = new Interop();
|
9661
|
9736
|
var Simulcast = require('sdp-simulcast');
|
9662
|
|
- this.simulcast = new Simulcast({numOfLayers: 2, explodeRemoteSimulcast: false});
|
|
9737
|
+ this.simulcast = new Simulcast({numOfLayers: 3, explodeRemoteSimulcast: false});
|
9663
|
9738
|
|
9664
|
9739
|
// override as desired
|
9665
|
9740
|
this.trace = function (what, info) {
|
|
@@ -10441,7 +10516,7 @@ Moderator.prototype.allocateConferenceFocus = function (callback) {
|
10441
|
10516
|
);
|
10442
|
10517
|
};
|
10443
|
10518
|
|
10444
|
|
-Moderator.prototype.getLoginUrl = function (urlCallback) {
|
|
10519
|
+Moderator.prototype.getLoginUrl = function (urlCallback, failureCallback) {
|
10445
|
10520
|
var iq = $iq({to: this.getFocusComponent(), type: 'get'});
|
10446
|
10521
|
iq.c('login-url', {
|
10447
|
10522
|
xmlns: 'http://jitsi.org/protocol/focus',
|
|
@@ -10459,14 +10534,17 @@ Moderator.prototype.getLoginUrl = function (urlCallback) {
|
10459
|
10534
|
} else {
|
10460
|
10535
|
logger.error(
|
10461
|
10536
|
"Failed to get auth url from the focus", result);
|
|
10537
|
+ failureCallback(result);
|
10462
|
10538
|
}
|
10463
|
10539
|
},
|
10464
|
10540
|
function (error) {
|
10465
|
10541
|
logger.error("Get auth url error", error);
|
|
10542
|
+ failureCallback(error);
|
10466
|
10543
|
}
|
10467
|
10544
|
);
|
10468
|
10545
|
};
|
10469
|
|
-Moderator.prototype.getPopupLoginUrl = function (urlCallback) {
|
|
10546
|
+
|
|
10547
|
+Moderator.prototype.getPopupLoginUrl = function (urlCallback, failureCallback) {
|
10470
|
10548
|
var iq = $iq({to: this.getFocusComponent(), type: 'get'});
|
10471
|
10549
|
iq.c('login-url', {
|
10472
|
10550
|
xmlns: 'http://jitsi.org/protocol/focus',
|
|
@@ -10485,10 +10563,12 @@ Moderator.prototype.getPopupLoginUrl = function (urlCallback) {
|
10485
|
10563
|
} else {
|
10486
|
10564
|
logger.error(
|
10487
|
10565
|
"Failed to get POPUP auth url from the focus", result);
|
|
10566
|
+ failureCallback(result);
|
10488
|
10567
|
}
|
10489
|
10568
|
},
|
10490
|
10569
|
function (error) {
|
10491
|
10570
|
logger.error('Get POPUP auth url error', error);
|
|
10571
|
+ failureCallback(error);
|
10492
|
10572
|
}
|
10493
|
10573
|
);
|
10494
|
10574
|
};
|
|
@@ -10523,9 +10603,6 @@ Moderator.prototype.logout = function (callback) {
|
10523
|
10603
|
|
10524
|
10604
|
module.exports = Moderator;
|
10525
|
10605
|
|
10526
|
|
-
|
10527
|
|
-
|
10528
|
|
-
|
10529
|
10606
|
}).call(this,"/modules/xmpp/moderator.js")
|
10530
|
10607
|
},{"../../service/authentication/AuthenticationEvents":81,"../../service/xmpp/XMPPEvents":85,"../settings/Settings":21,"jitsi-meet-logger":47}],35:[function(require,module,exports){
|
10531
|
10608
|
(function (__filename){
|