|
|
@@ -975,6 +975,8 @@ var currentBrowser;
|
|
975
|
975
|
|
|
976
|
976
|
var browserVersion;
|
|
977
|
977
|
|
|
|
978
|
+var isAndroid;
|
|
|
979
|
+
|
|
978
|
980
|
var RTCBrowserType = {
|
|
979
|
981
|
|
|
980
|
982
|
RTC_BROWSER_CHROME: "rtc_browser.chrome",
|
|
|
@@ -1027,6 +1029,13 @@ var RTCBrowserType = {
|
|
1027
|
1029
|
|
|
1028
|
1030
|
usesUnifiedPlan: function() {
|
|
1029
|
1031
|
return RTCBrowserType.isFirefox();
|
|
|
1032
|
+ },
|
|
|
1033
|
+
|
|
|
1034
|
+ /**
|
|
|
1035
|
+ * Whether the browser is running on an android device.
|
|
|
1036
|
+ */
|
|
|
1037
|
+ isAndroid: function() {
|
|
|
1038
|
+ return isAndroid;
|
|
1030
|
1039
|
}
|
|
1031
|
1040
|
|
|
1032
|
1041
|
// Add version getters for other browsers when needed
|
|
|
@@ -1129,6 +1138,7 @@ function detectBrowser() {
|
|
1129
|
1138
|
}
|
|
1130
|
1139
|
|
|
1131
|
1140
|
browserVersion = detectBrowser();
|
|
|
1141
|
+isAndroid = navigator.userAgent.indexOf('Android') != -1;
|
|
1132
|
1142
|
|
|
1133
|
1143
|
module.exports = RTCBrowserType;
|
|
1134
|
1144
|
},{}],9:[function(require,module,exports){
|
|
|
@@ -1156,7 +1166,8 @@ function getPreviousResolution(resolution) {
|
|
1156
|
1166
|
return resName;
|
|
1157
|
1167
|
}
|
|
1158
|
1168
|
|
|
1159
|
|
-function setResolutionConstraints(constraints, resolution, isAndroid) {
|
|
|
1169
|
+function setResolutionConstraints(constraints, resolution) {
|
|
|
1170
|
+ var isAndroid = RTCBrowserType.isAndroid();
|
|
1160
|
1171
|
|
|
1161
|
1172
|
if (Resolutions[resolution]) {
|
|
1162
|
1173
|
constraints.video.mandatory.minWidth = Resolutions[resolution].width;
|
|
|
@@ -1178,8 +1189,7 @@ function setResolutionConstraints(constraints, resolution, isAndroid) {
|
|
1178
|
1189
|
constraints.video.mandatory.minHeight;
|
|
1179
|
1190
|
}
|
|
1180
|
1191
|
|
|
1181
|
|
-function getConstraints(um, resolution, bandwidth, fps, desktopStream, isAndroid)
|
|
1182
|
|
-{
|
|
|
1192
|
+function getConstraints(um, resolution, bandwidth, fps, desktopStream) {
|
|
1183
|
1193
|
var constraints = {audio: false, video: false};
|
|
1184
|
1194
|
|
|
1185
|
1195
|
if (um.indexOf('video') >= 0) {
|
|
|
@@ -1188,7 +1198,7 @@ function getConstraints(um, resolution, bandwidth, fps, desktopStream, isAndroid
|
|
1188
|
1198
|
|
|
1189
|
1199
|
constraints.video.optional.push({ googLeakyBucket: true });
|
|
1190
|
1200
|
|
|
1191
|
|
- setResolutionConstraints(constraints, resolution, isAndroid);
|
|
|
1201
|
+ setResolutionConstraints(constraints, resolution);
|
|
1192
|
1202
|
}
|
|
1193
|
1203
|
if (um.indexOf('audio') >= 0) {
|
|
1194
|
1204
|
if (!RTCBrowserType.isFirefox()) {
|
|
|
@@ -1343,7 +1353,7 @@ function RTCUtils(RTCService, onTemasysPluginReady)
|
|
1343
|
1353
|
};
|
|
1344
|
1354
|
// DTLS should now be enabled by default but..
|
|
1345
|
1355
|
this.pc_constraints = {'optional': [{'DtlsSrtpKeyAgreement': 'true'}]};
|
|
1346
|
|
- if (navigator.userAgent.indexOf('Android') != -1) {
|
|
|
1356
|
+ if (RTCBrowserType.isAndroid()) {
|
|
1347
|
1357
|
this.pc_constraints = {}; // disable DTLS on Android
|
|
1348
|
1358
|
}
|
|
1349
|
1359
|
if (!webkitMediaStream.prototype.getVideoTracks) {
|
|
|
@@ -1420,11 +1430,9 @@ RTCUtils.prototype.getUserMediaWithConstraints = function(
|
|
1420
|
1430
|
um, success_callback, failure_callback, resolution,bandwidth, fps,
|
|
1421
|
1431
|
desktopStream) {
|
|
1422
|
1432
|
currentResolution = resolution;
|
|
1423
|
|
- // Check if we are running on Android device
|
|
1424
|
|
- var isAndroid = navigator.userAgent.indexOf('Android') != -1;
|
|
1425
|
1433
|
|
|
1426
|
1434
|
var constraints = getConstraints(
|
|
1427
|
|
- um, resolution, bandwidth, fps, desktopStream, isAndroid);
|
|
|
1435
|
+ um, resolution, bandwidth, fps, desktopStream);
|
|
1428
|
1436
|
|
|
1429
|
1437
|
console.info("Get media constraints", constraints);
|
|
1430
|
1438
|
|
|
|
@@ -3280,14 +3288,17 @@ function registerListeners() {
|
|
3280
|
3288
|
APP.xmpp.addListener(XMPPEvents.ETHERPAD, initEtherpad);
|
|
3281
|
3289
|
APP.xmpp.addListener(XMPPEvents.AUTHENTICATION_REQUIRED,
|
|
3282
|
3290
|
onAuthenticationRequired);
|
|
3283
|
|
- APP.xmpp.addListener(XMPPEvents.VIDEO_TYPE, onPeerVideoTypeChanged);
|
|
|
3291
|
+ APP.xmpp.addListener(XMPPEvents.PARTICIPANT_VIDEO_TYPE_CHANGED,
|
|
|
3292
|
+ onPeerVideoTypeChanged);
|
|
3284
|
3293
|
APP.xmpp.addListener(XMPPEvents.DEVICE_AVAILABLE,
|
|
3285
|
3294
|
function (resource, devices) {
|
|
3286
|
3295
|
VideoLayout.setDeviceAvailabilityIcons(resource, devices);
|
|
3287
|
3296
|
});
|
|
3288
|
3297
|
|
|
3289
|
|
- APP.xmpp.addListener(XMPPEvents.AUDIO_MUTED, VideoLayout.onAudioMute);
|
|
3290
|
|
- APP.xmpp.addListener(XMPPEvents.VIDEO_MUTED, VideoLayout.onVideoMute);
|
|
|
3298
|
+ APP.xmpp.addListener(XMPPEvents.PARTICIPANT_AUDIO_MUTED,
|
|
|
3299
|
+ VideoLayout.onAudioMute);
|
|
|
3300
|
+ APP.xmpp.addListener(XMPPEvents.PARTICIPANT_VIDEO_MUTED,
|
|
|
3301
|
+ VideoLayout.onVideoMute);
|
|
3291
|
3302
|
APP.xmpp.addListener(XMPPEvents.AUDIO_MUTED_BY_FOCUS, function (doMuteAudio) {
|
|
3292
|
3303
|
UI.setAudioMuted(doMuteAudio);
|
|
3293
|
3304
|
});
|
|
|
@@ -14780,10 +14791,11 @@ JingleSessionPC.prototype.setLocalDescription = function () {
|
|
14780
|
14791
|
}
|
|
14781
|
14792
|
|
|
14782
|
14793
|
// an attempt to work around https://github.com/jitsi/jitmeet/issues/32
|
|
|
14794
|
+// TODO: is this hack (along with the XMPPEvent-s used only for it) still needed
|
|
|
14795
|
+// now that we announce an SSRC for receive-only streams?
|
|
14783
|
14796
|
function sendKeyframe(pc) {
|
|
14784
|
14797
|
console.log('sendkeyframe', pc.iceConnectionState);
|
|
14785
|
14798
|
if (pc.iceConnectionState !== 'connected') return; // safe...
|
|
14786
|
|
- var self = this;
|
|
14787
|
14799
|
pc.setRemoteDescription(
|
|
14788
|
14800
|
pc.remoteDescription,
|
|
14789
|
14801
|
function () {
|
|
|
@@ -14856,6 +14868,8 @@ JingleSessionPC.prototype.remoteStreamAdded = function (data, times) {
|
|
14856
|
14868
|
|
|
14857
|
14869
|
var isVideo = data.stream.getVideoTracks().length > 0;
|
|
14858
|
14870
|
// an attempt to work around https://github.com/jitsi/jitmeet/issues/32
|
|
|
14871
|
+ // TODO: is this hack still needed now that we announce an SSRC for
|
|
|
14872
|
+ // receive-only streams?
|
|
14859
|
14873
|
if (isVideo &&
|
|
14860
|
14874
|
data.peerjid && this.peerjid === data.peerjid &&
|
|
14861
|
14875
|
data.stream.getVideoTracks().length === 0 &&
|
|
|
@@ -17461,10 +17475,11 @@ module.exports = function(XMPP, eventEmitter) {
|
|
17461
|
17475
|
}
|
|
17462
|
17476
|
}
|
|
17463
|
17477
|
|
|
|
17478
|
+ var url;
|
|
17464
|
17479
|
// Parse prezi tag.
|
|
17465
|
17480
|
var presentation = $(pres).find('>prezi');
|
|
17466
|
17481
|
if (presentation.length) {
|
|
17467
|
|
- var url = presentation.attr('url');
|
|
|
17482
|
+ url = presentation.attr('url');
|
|
17468
|
17483
|
var current = presentation.find('>current').text();
|
|
17469
|
17484
|
|
|
17470
|
17485
|
console.log('presentation info received from', from, url);
|
|
|
@@ -17479,7 +17494,7 @@ module.exports = function(XMPP, eventEmitter) {
|
|
17479
|
17494
|
}
|
|
17480
|
17495
|
}
|
|
17481
|
17496
|
else if (this.preziMap[from] != null) {
|
|
17482
|
|
- var url = this.preziMap[from];
|
|
|
17497
|
+ url = this.preziMap[from];
|
|
17483
|
17498
|
delete this.preziMap[from];
|
|
17484
|
17499
|
$(document).trigger('presentationremoved.muc', [from, url]);
|
|
17485
|
17500
|
}
|
|
|
@@ -17487,22 +17502,22 @@ module.exports = function(XMPP, eventEmitter) {
|
|
17487
|
17502
|
// Parse audio info tag.
|
|
17488
|
17503
|
var audioMuted = $(pres).find('>audiomuted');
|
|
17489
|
17504
|
if (audioMuted.length) {
|
|
17490
|
|
- eventEmitter.emit(XMPPEvents.AUDIO_MUTED,
|
|
|
17505
|
+ eventEmitter.emit(XMPPEvents.PARTICIPANT_AUDIO_MUTED,
|
|
17491
|
17506
|
from, (audioMuted.text() === "true"));
|
|
17492
|
17507
|
}
|
|
17493
|
17508
|
|
|
17494
|
17509
|
// Parse video info tag.
|
|
17495
|
17510
|
var videoMuted = $(pres).find('>videomuted');
|
|
17496
|
17511
|
if (videoMuted.length) {
|
|
17497
|
|
- eventEmitter.emit(XMPPEvents.VIDEO_MUTED,
|
|
|
17512
|
+ eventEmitter.emit(XMPPEvents.PARTICIPANT_VIDEO_MUTED,
|
|
17498
|
17513
|
from, (videoMuted.text() === "true"));
|
|
17499
|
17514
|
}
|
|
17500
|
17515
|
|
|
17501
|
17516
|
var startMuted = $(pres).find('>startmuted');
|
|
17502
|
|
- if (startMuted.length)
|
|
17503
|
|
- {
|
|
|
17517
|
+ if (startMuted.length && Moderator.isPeerModerator(from)) {
|
|
17504
|
17518
|
eventEmitter.emit(XMPPEvents.START_MUTED_SETTING_CHANGED,
|
|
17505
|
|
- startMuted.attr("audio") === "true", startMuted.attr("video") === "true");
|
|
|
17519
|
+ startMuted.attr("audio") === "true",
|
|
|
17520
|
+ startMuted.attr("video") === "true");
|
|
17506
|
17521
|
}
|
|
17507
|
17522
|
|
|
17508
|
17523
|
var devices = $(pres).find('>devices');
|
|
|
@@ -17529,7 +17544,7 @@ module.exports = function(XMPP, eventEmitter) {
|
|
17529
|
17544
|
{
|
|
17530
|
17545
|
if (videoType.text().length)
|
|
17531
|
17546
|
{
|
|
17532
|
|
- eventEmitter.emit(XMPPEvents.VIDEO_TYPE,
|
|
|
17547
|
+ eventEmitter.emit(XMPPEvents.PARTICIPANT_VIDEO_TYPE_CHANGED,
|
|
17533
|
17548
|
Strophe.getResourceFromJid(from), videoType.text());
|
|
17534
|
17549
|
}
|
|
17535
|
17550
|
}
|
|
|
@@ -37770,49 +37785,87 @@ module.exports = {
|
|
37770
|
37785
|
}
|
|
37771
|
37786
|
},{}],161:[function(require,module,exports){
|
|
37772
|
37787
|
var XMPPEvents = {
|
|
|
37788
|
+ // Designates an event indicating that the connection to the XMPP server
|
|
|
37789
|
+ // failed.
|
|
37773
|
37790
|
CONNECTION_FAILED: "xmpp.connection.failed",
|
|
37774
|
|
- // Indicates an interrupted connection event.
|
|
|
37791
|
+ // Designates an event indicating that the media (ICE) connection was
|
|
|
37792
|
+ // interrupted. This should go to the RTC module.
|
|
37775
|
37793
|
CONNECTION_INTERRUPTED: "xmpp.connection.interrupted",
|
|
37776
|
|
- // Indicates a restored connection event.
|
|
|
37794
|
+ // Designates an event indicating that the media (ICE) connection was
|
|
|
37795
|
+ // restored. This should go to the RTC module.
|
|
37777
|
37796
|
CONNECTION_RESTORED: "xmpp.connection.restored",
|
|
37778
|
|
- CONFERENCE_CREATED: "xmpp.conferenceCreated.jingle",
|
|
|
37797
|
+ // Designates an event indicating that an offer (e.g. Jingle
|
|
|
37798
|
+ // session-initiate) was received.
|
|
37779
|
37799
|
CALL_INCOMING: "xmpp.callincoming.jingle",
|
|
37780
|
|
- DISPOSE_CONFERENCE: "xmpp.dispose_conference",
|
|
37781
|
|
- GRACEFUL_SHUTDOWN: "xmpp.graceful_shutdown",
|
|
|
37800
|
+ // Designates an event indicating that we were kicked from the XMPP MUC.
|
|
37782
|
37801
|
KICKED: "xmpp.kicked",
|
|
37783
|
|
- BRIDGE_DOWN: "xmpp.bridge_down",
|
|
|
37802
|
+ // Designates an event indicating that the userID for a specific JID has
|
|
|
37803
|
+ // changed.
|
|
37784
|
37804
|
USER_ID_CHANGED: "xmpp.user_id_changed",
|
|
37785
|
|
- // We joined the MUC
|
|
|
37805
|
+ // Designates an event indicating that we have joined the XMPP MUC.
|
|
37786
|
37806
|
MUC_JOINED: "xmpp.muc_joined",
|
|
37787
|
|
- // A member joined the MUC
|
|
|
37807
|
+ // Designates an event indicating that a participant joined the XMPP MUC.
|
|
37788
|
37808
|
MUC_MEMBER_JOINED: "xmpp.muc_member_joined",
|
|
37789
|
|
- // A member left the MUC
|
|
|
37809
|
+ // Designates an event indicating that a participant left the XMPP MUC.
|
|
37790
|
37810
|
MUC_MEMBER_LEFT: "xmpp.muc_member_left",
|
|
|
37811
|
+ // Designates an event indicating that the MUC role of a participant has
|
|
|
37812
|
+ // changed.
|
|
37791
|
37813
|
MUC_ROLE_CHANGED: "xmpp.muc_role_changed",
|
|
|
37814
|
+ // Designates an event indicating that the XMPP MUC was destroyed.
|
|
37792
|
37815
|
MUC_DESTROYED: "xmpp.muc_destroyed",
|
|
|
37816
|
+ // Designates an event indicating that the display name of a participant
|
|
|
37817
|
+ // has changed.
|
|
37793
|
37818
|
DISPLAY_NAME_CHANGED: "xmpp.display_name_changed",
|
|
|
37819
|
+ // Designates an event indicating that we received statistics from a
|
|
|
37820
|
+ // participant in the MUC.
|
|
37794
|
37821
|
REMOTE_STATS: "xmpp.remote_stats",
|
|
|
37822
|
+ // Designates an event indicating that our role in the XMPP MUC has changed.
|
|
37795
|
37823
|
LOCAL_ROLE_CHANGED: "xmpp.localrole_changed",
|
|
37796
|
|
- PRESENCE_STATUS: "xmpp.presence_status",
|
|
37797
|
|
- RESERVATION_ERROR: "xmpp.room_reservation_error",
|
|
|
37824
|
+ // Designates an event indicating that the subject of the XMPP MUC has
|
|
|
37825
|
+ // changed.
|
|
37798
|
37826
|
SUBJECT_CHANGED: "xmpp.subject_changed",
|
|
|
37827
|
+ // Designates an event indicating that an XMPP message in the MUC was
|
|
|
37828
|
+ // received.
|
|
37799
|
37829
|
MESSAGE_RECEIVED: "xmpp.message_received",
|
|
|
37830
|
+ // Designates an event indicating that we sent an XMPP message to the MUC.
|
|
37800
|
37831
|
SENDING_CHAT_MESSAGE: "xmpp.sending_chat_message",
|
|
|
37832
|
+ // Designates an event indicating that the video type (e.g. 'camera' or
|
|
|
37833
|
+ // 'screen') for a participant has changed.
|
|
|
37834
|
+ PARTICIPANT_VIDEO_TYPE_CHANGED: "xmpp.video_type",
|
|
|
37835
|
+ // Designates an event indicating that a participant in the XMPP MUC has
|
|
|
37836
|
+ // advertised that they have audio muted (or unmuted).
|
|
|
37837
|
+ PARTICIPANT_AUDIO_MUTED: "xmpp.audio_muted",
|
|
|
37838
|
+ // Designates an event indicating that a participant in the XMPP MUC has
|
|
|
37839
|
+ // advertised that they have video muted (or unmuted).
|
|
|
37840
|
+ PARTICIPANT_VIDEO_MUTED: "xmpp.video_muted",
|
|
|
37841
|
+ // Designates an event indicating that the focus has asked us to mute our
|
|
|
37842
|
+ // audio.
|
|
|
37843
|
+ AUDIO_MUTED_BY_FOCUS: "xmpp.audio_muted_by_focus",
|
|
|
37844
|
+ // Designates an event indicating that a moderator in the room changed the
|
|
|
37845
|
+ // "start muted" settings for the conference.
|
|
|
37846
|
+ START_MUTED_SETTING_CHANGED: "xmpp.start_muted_setting_changed",
|
|
|
37847
|
+ // Designates an event indicating that we should join the conference with
|
|
|
37848
|
+ // audio and/or video muted.
|
|
|
37849
|
+ START_MUTED_FROM_FOCUS: "xmpp.start_muted_from_focus",
|
|
|
37850
|
+
|
|
|
37851
|
+
|
|
|
37852
|
+ PEERCONNECTION_READY: "xmpp.peerconnection_ready",
|
|
|
37853
|
+ CONFERENCE_SETUP_FAILED: "xmpp.conference_setup_failed",
|
|
37801
|
37854
|
PASSWORD_REQUIRED: "xmpp.password_required",
|
|
37802
|
37855
|
AUTHENTICATION_REQUIRED: "xmpp.authentication_required",
|
|
37803
|
37856
|
CHAT_ERROR_RECEIVED: "xmpp.chat_error_received",
|
|
37804
|
37857
|
ETHERPAD: "xmpp.etherpad",
|
|
37805
|
37858
|
DEVICE_AVAILABLE: "xmpp.device_available",
|
|
37806
|
|
- VIDEO_TYPE: "xmpp.video_type",
|
|
37807
|
|
- PEERCONNECTION_READY: "xmpp.peerconnection_ready",
|
|
37808
|
|
- CONFERENCE_SETUP_FAILED: "xmpp.conference_setup_failed",
|
|
37809
|
|
- AUDIO_MUTED: "xmpp.audio_muted",
|
|
37810
|
|
- VIDEO_MUTED: "xmpp.video_muted",
|
|
37811
|
|
- AUDIO_MUTED_BY_FOCUS: "xmpp.audio_muted_by_focus",
|
|
37812
|
|
- START_MUTED_SETTING_CHANGED: "xmpp.start_muted_setting_changed",
|
|
37813
|
|
- START_MUTED_FROM_FOCUS: "xmpp.start_muted_from_focus",
|
|
|
37859
|
+ BRIDGE_DOWN: "xmpp.bridge_down",
|
|
|
37860
|
+ PRESENCE_STATUS: "xmpp.presence_status",
|
|
|
37861
|
+ RESERVATION_ERROR: "xmpp.room_reservation_error",
|
|
|
37862
|
+ DISPOSE_CONFERENCE: "xmpp.dispose_conference",
|
|
|
37863
|
+ GRACEFUL_SHUTDOWN: "xmpp.graceful_shutdown",
|
|
|
37864
|
+ // TODO: only used in a hack, should probably be removed.
|
|
37814
|
37865
|
SET_LOCAL_DESCRIPTION_ERROR: 'xmpp.set_local_description_error',
|
|
|
37866
|
+ // TODO: only used in a hack, should probably be removed.
|
|
37815
|
37867
|
SET_REMOTE_DESCRIPTION_ERROR: 'xmpp.set_remote_description_error',
|
|
|
37868
|
+ // TODO: only used in a hack, should probably be removed.
|
|
37816
|
37869
|
CREATE_ANSWER_ERROR: 'xmpp.create_answer_error',
|
|
37817
|
37870
|
JINGLE_FATAL_ERROR: 'xmpp.jingle_fatal_error',
|
|
37818
|
37871
|
PROMPT_FOR_LOGIN: 'xmpp.prompt_for_login',
|