|
|
@@ -972,6 +972,19 @@ var RTC = {
|
|
972
|
972
|
oldStream.stop();
|
|
973
|
973
|
APP.xmpp.switchStreams(newStream, oldStream, callback, true);
|
|
974
|
974
|
},
|
|
|
975
|
+ isVideoMuted: function (jid) {
|
|
|
976
|
+ if (jid === APP.xmpp.myJid()) {
|
|
|
977
|
+ var localVideo = APP.RTC.localVideo;
|
|
|
978
|
+ return (!localVideo || localVideo.isMuted());
|
|
|
979
|
+ }
|
|
|
980
|
+ else
|
|
|
981
|
+ {
|
|
|
982
|
+ if (!APP.RTC.remoteStreams[jid] || !APP.RTC.remoteStreams[jid][MediaStreamType.VIDEO_TYPE]) {
|
|
|
983
|
+ return null;
|
|
|
984
|
+ }
|
|
|
985
|
+ return APP.RTC.remoteStreams[jid][MediaStreamType.VIDEO_TYPE].muted;
|
|
|
986
|
+ }
|
|
|
987
|
+ },
|
|
975
|
988
|
/**
|
|
976
|
989
|
* Checks if video identified by given src is desktop stream.
|
|
977
|
990
|
* @param videoSrc eg.
|
|
|
@@ -1747,6 +1760,8 @@ function registerListeners() {
|
|
1747
|
1760
|
VideoLayout.setDeviceAvailabilityIcons(resource, devices);
|
|
1748
|
1761
|
});
|
|
1749
|
1762
|
|
|
|
1763
|
+ APP.xmpp.addListener(XMPPEvents.AUDIO_MUTED, VideoLayout.onAudioMute);
|
|
|
1764
|
+ APP.xmpp.addListener(XMPPEvents.VIDEO_MUTED, VideoLayout.onVideoMute);
|
|
1750
|
1765
|
APP.members.addListener(MemberEvents.DTMF_SUPPORT_CHANGED,
|
|
1751
|
1766
|
onDtmfSupportChanged);
|
|
1752
|
1767
|
APP.xmpp.addListener(XMPPEvents.START_MUTED, function (audio, video) {
|
|
|
@@ -2305,6 +2320,12 @@ UI.setVideoMuteButtonsState = function (mute) {
|
|
2305
|
2320
|
}
|
|
2306
|
2321
|
}
|
|
2307
|
2322
|
|
|
|
2323
|
+UI.userAvatarChanged = function (resourceJid, thumbUrl, contactListUrl) {
|
|
|
2324
|
+ VideoLayout.userAvatarChanged(resourceJid, thumbUrl);
|
|
|
2325
|
+ ContactList.userAvatarChanged(resourceJid, contactListUrl);
|
|
|
2326
|
+ if(resourceJid === APP.xmpp.myResource())
|
|
|
2327
|
+ SettingsMenu.changeAvatar(thumbUrl);
|
|
|
2328
|
+}
|
|
2308
|
2329
|
|
|
2309
|
2330
|
UI.setVideoMute = setVideoMute;
|
|
2310
|
2331
|
|
|
|
@@ -3045,46 +3066,8 @@ var LoginDialog = {
|
|
3045
|
3066
|
module.exports = LoginDialog;
|
|
3046
|
3067
|
},{"../../xmpp/moderator":56,"../../xmpp/xmpp":64}],14:[function(require,module,exports){
|
|
3047
|
3068
|
var Settings = require("../../settings/Settings");
|
|
3048
|
|
-var MediaStreamType = require("../../../service/RTC/MediaStreamTypes");
|
|
3049
|
3069
|
|
|
3050
|
3070
|
var users = {};
|
|
3051
|
|
-var activeSpeakerJid;
|
|
3052
|
|
-
|
|
3053
|
|
-function setVisibility(selector, show) {
|
|
3054
|
|
- if (selector && selector.length > 0) {
|
|
3055
|
|
- selector.css("visibility", show ? "visible" : "hidden");
|
|
3056
|
|
- }
|
|
3057
|
|
-}
|
|
3058
|
|
-
|
|
3059
|
|
-function isUserMuted(jid) {
|
|
3060
|
|
- // XXX(gp) we may want to rename this method to something like
|
|
3061
|
|
- // isUserStreaming, for example.
|
|
3062
|
|
- if (jid != APP.xmpp.myJid()) {
|
|
3063
|
|
- var resource = Strophe.getResourceFromJid(jid);
|
|
3064
|
|
- if (!require("../videolayout/VideoLayout").isInLastN(resource)) {
|
|
3065
|
|
- return true;
|
|
3066
|
|
- }
|
|
3067
|
|
- }
|
|
3068
|
|
- else
|
|
3069
|
|
- {
|
|
3070
|
|
- var localVideo = APP.RTC.localVideo;
|
|
3071
|
|
- return (!localVideo || localVideo.isMuted());
|
|
3072
|
|
- }
|
|
3073
|
|
-
|
|
3074
|
|
- if (!APP.RTC.remoteStreams[jid] || !APP.RTC.remoteStreams[jid][MediaStreamType.VIDEO_TYPE]) {
|
|
3075
|
|
- return null;
|
|
3076
|
|
- }
|
|
3077
|
|
- return APP.RTC.remoteStreams[jid][MediaStreamType.VIDEO_TYPE].muted;
|
|
3078
|
|
-}
|
|
3079
|
|
-
|
|
3080
|
|
-function getGravatarUrl(id, size) {
|
|
3081
|
|
- if(id === APP.xmpp.myJid() || !id) {
|
|
3082
|
|
- id = Settings.getSettings().uid;
|
|
3083
|
|
- }
|
|
3084
|
|
- return 'https://www.gravatar.com/avatar/' +
|
|
3085
|
|
- MD5.hexdigest(id.trim().toLowerCase()) +
|
|
3086
|
|
- "?d=wavatar&size=" + (size || "30");
|
|
3087
|
|
-}
|
|
3088
|
3071
|
|
|
3089
|
3072
|
var Avatar = {
|
|
3090
|
3073
|
|
|
|
@@ -3101,107 +3084,26 @@ var Avatar = {
|
|
3101
|
3084
|
}
|
|
3102
|
3085
|
users[jid] = id;
|
|
3103
|
3086
|
}
|
|
3104
|
|
- var thumbUrl = getGravatarUrl(users[jid] || jid, 100);
|
|
3105
|
|
- var contactListUrl = getGravatarUrl(users[jid] || jid);
|
|
|
3087
|
+ var thumbUrl = this.getGravatarUrl(users[jid] || jid, 100);
|
|
|
3088
|
+ var contactListUrl = this.getGravatarUrl(users[jid] || jid);
|
|
3106
|
3089
|
var resourceJid = Strophe.getResourceFromJid(jid);
|
|
3107
|
|
- var thumbnail = $('#participant_' + resourceJid);
|
|
3108
|
|
- var avatar = $('#avatar_' + resourceJid);
|
|
3109
|
3090
|
|
|
3110
|
|
- // set the avatar in the settings menu if it is local user and get the
|
|
3111
|
|
- // local video container
|
|
3112
|
|
- if (jid === APP.xmpp.myJid()) {
|
|
3113
|
|
- $('#avatar').get(0).src = thumbUrl;
|
|
3114
|
|
- thumbnail = $('#localVideoContainer');
|
|
3115
|
|
- }
|
|
3116
|
|
-
|
|
3117
|
|
- // set the avatar in the contact list
|
|
3118
|
|
- var contact = $('#' + resourceJid + '>img');
|
|
3119
|
|
- if (contact && contact.length > 0) {
|
|
3120
|
|
- contact.get(0).src = contactListUrl;
|
|
3121
|
|
- }
|
|
3122
|
|
-
|
|
3123
|
|
- // set the avatar in the thumbnail
|
|
3124
|
|
- if (avatar && avatar.length > 0) {
|
|
3125
|
|
- avatar[0].src = thumbUrl;
|
|
3126
|
|
- } else {
|
|
3127
|
|
- if (thumbnail && thumbnail.length > 0) {
|
|
3128
|
|
- avatar = document.createElement('img');
|
|
3129
|
|
- avatar.id = 'avatar_' + resourceJid;
|
|
3130
|
|
- avatar.className = 'userAvatar';
|
|
3131
|
|
- avatar.src = thumbUrl;
|
|
3132
|
|
- thumbnail.append(avatar);
|
|
3133
|
|
- }
|
|
3134
|
|
- }
|
|
3135
|
|
-
|
|
3136
|
|
- //if the user is the current active speaker - update the active speaker
|
|
3137
|
|
- // avatar
|
|
3138
|
|
- if (jid === activeSpeakerJid) {
|
|
3139
|
|
- this.updateActiveSpeakerAvatarSrc(jid);
|
|
3140
|
|
- }
|
|
|
3091
|
+ APP.UI.userAvatarChanged(resourceJid, thumbUrl, contactListUrl);
|
|
3141
|
3092
|
},
|
|
3142
|
|
-
|
|
3143
|
|
- /**
|
|
3144
|
|
- * Hides or shows the user's avatar
|
|
3145
|
|
- * @param jid jid of the user
|
|
3146
|
|
- * @param show whether we should show the avatar or not
|
|
3147
|
|
- * video because there is no dominant speaker and no focused speaker
|
|
3148
|
|
- */
|
|
3149
|
|
- showUserAvatar: function (jid, show) {
|
|
3150
|
|
- if (users[jid]) {
|
|
3151
|
|
- var resourceJid = Strophe.getResourceFromJid(jid);
|
|
3152
|
|
- var video = $('#participant_' + resourceJid + '>video');
|
|
3153
|
|
- var avatar = $('#avatar_' + resourceJid);
|
|
3154
|
|
-
|
|
3155
|
|
- if (jid === APP.xmpp.myJid()) {
|
|
3156
|
|
- video = $('#localVideoWrapper>video');
|
|
3157
|
|
- }
|
|
3158
|
|
- if (show === undefined || show === null) {
|
|
3159
|
|
- show = isUserMuted(jid);
|
|
3160
|
|
- }
|
|
3161
|
|
-
|
|
3162
|
|
- //if the user is the currently focused, the dominant speaker or if
|
|
3163
|
|
- //there is no focused and no dominant speaker and the large video is
|
|
3164
|
|
- //currently shown
|
|
3165
|
|
- if (activeSpeakerJid === jid && require("../videolayout/LargeVideo").isLargeVideoOnTop()) {
|
|
3166
|
|
- setVisibility($("#largeVideo"), !show);
|
|
3167
|
|
- setVisibility($('#activeSpeaker'), show);
|
|
3168
|
|
- setVisibility(avatar, false);
|
|
3169
|
|
- setVisibility(video, false);
|
|
3170
|
|
- } else {
|
|
3171
|
|
- if (video && video.length > 0) {
|
|
3172
|
|
- setVisibility(video, !show);
|
|
3173
|
|
- }
|
|
3174
|
|
- setVisibility(avatar, show);
|
|
3175
|
|
-
|
|
3176
|
|
- }
|
|
3177
|
|
- }
|
|
3178
|
|
- },
|
|
3179
|
|
-
|
|
3180
|
|
- /**
|
|
3181
|
|
- * Updates the src of the active speaker avatar
|
|
3182
|
|
- * @param jid of the current active speaker
|
|
3183
|
|
- */
|
|
3184
|
|
- updateActiveSpeakerAvatarSrc: function (jid) {
|
|
3185
|
|
- var avatar = $("#activeSpeakerAvatar")[0];
|
|
3186
|
|
- var url = getGravatarUrl(users[jid],
|
|
3187
|
|
- interfaceConfig.ACTIVE_SPEAKER_AVATAR_SIZE);
|
|
3188
|
|
- if (jid === activeSpeakerJid && avatar.src === url) {
|
|
3189
|
|
- return;
|
|
3190
|
|
- }
|
|
3191
|
|
- activeSpeakerJid = jid;
|
|
3192
|
|
- var isMuted = isUserMuted(jid);
|
|
3193
|
|
- if (jid && isMuted !== null) {
|
|
3194
|
|
- avatar.src = url;
|
|
3195
|
|
- setVisibility($("#largeVideo"), !isMuted);
|
|
3196
|
|
- Avatar.showUserAvatar(jid, isMuted);
|
|
|
3093
|
+ getGravatarUrl: function (id, size) {
|
|
|
3094
|
+ if(id === APP.xmpp.myJid() || !id) {
|
|
|
3095
|
+ id = Settings.getSettings().uid;
|
|
3197
|
3096
|
}
|
|
|
3097
|
+ return 'https://www.gravatar.com/avatar/' +
|
|
|
3098
|
+ MD5.hexdigest(id.trim().toLowerCase()) +
|
|
|
3099
|
+ "?d=wavatar&size=" + (size || "30");
|
|
3198
|
3100
|
}
|
|
3199
|
3101
|
|
|
3200
|
3102
|
};
|
|
3201
|
3103
|
|
|
3202
|
3104
|
|
|
3203
|
3105
|
module.exports = Avatar;
|
|
3204
|
|
-},{"../../../service/RTC/MediaStreamTypes":100,"../../settings/Settings":45,"../videolayout/LargeVideo":33,"../videolayout/VideoLayout":37}],15:[function(require,module,exports){
|
|
|
3106
|
+},{"../../settings/Settings":45}],15:[function(require,module,exports){
|
|
3205
|
3107
|
/* global $, config,
|
|
3206
|
3108
|
setLargeVideoVisible, Util */
|
|
3207
|
3109
|
|
|
|
@@ -4981,6 +4883,15 @@ var ContactList = {
|
|
4981
|
4883
|
|
|
4982
|
4884
|
if (contactName && displayName && displayName.length > 0)
|
|
4983
|
4885
|
contactName.html(displayName);
|
|
|
4886
|
+ },
|
|
|
4887
|
+
|
|
|
4888
|
+ userAvatarChanged: function (resourceJid, contactListUrl) {
|
|
|
4889
|
+ // set the avatar in the contact list
|
|
|
4890
|
+ var contact = $('#' + resourceJid + '>img');
|
|
|
4891
|
+ if (contact && contact.length > 0) {
|
|
|
4892
|
+ contact.get(0).src = contactListUrl;
|
|
|
4893
|
+ }
|
|
|
4894
|
+
|
|
4984
|
4895
|
}
|
|
4985
|
4896
|
};
|
|
4986
|
4897
|
|
|
|
@@ -5090,6 +5001,9 @@ var SettingsMenu = {
|
|
5090
|
5001
|
peerJid === APP.xmpp.myJid()) {
|
|
5091
|
5002
|
this.setDisplayName(newDisplayName);
|
|
5092
|
5003
|
}
|
|
|
5004
|
+ },
|
|
|
5005
|
+ changeAvatar: function (thumbUrl) {
|
|
|
5006
|
+ $('#avatar').get(0).src = thumbUrl;
|
|
5093
|
5007
|
}
|
|
5094
|
5008
|
};
|
|
5095
|
5009
|
|
|
|
@@ -6952,9 +6866,34 @@ function getCameraVideoSize(videoWidth,
|
|
6952
|
6866
|
return [availableWidth, availableHeight];
|
|
6953
|
6867
|
}
|
|
6954
|
6868
|
|
|
|
6869
|
+/**
|
|
|
6870
|
+ * Updates the src of the active speaker avatar
|
|
|
6871
|
+ * @param jid of the current active speaker
|
|
|
6872
|
+ */
|
|
|
6873
|
+function updateActiveSpeakerAvatarSrc() {
|
|
|
6874
|
+ var avatar = $("#activeSpeakerAvatar")[0];
|
|
|
6875
|
+ var jid = currentSmallVideo.peerJid;
|
|
|
6876
|
+ var url = Avatar.getGravatarUrl(jid);
|
|
|
6877
|
+ if(avatar.src === url)
|
|
|
6878
|
+ return;
|
|
|
6879
|
+ var isMuted = null;
|
|
|
6880
|
+ if(!LargeVideo.VideoLayout.isInLastN(currentSmallVideo.resourceJid)) {
|
|
|
6881
|
+ isMuted = true;
|
|
|
6882
|
+ }
|
|
|
6883
|
+ else
|
|
|
6884
|
+ {
|
|
|
6885
|
+ isMuted = APP.RTC.isVideoMuted(jid);
|
|
|
6886
|
+ }
|
|
|
6887
|
+
|
|
|
6888
|
+ if (jid && isMuted !== null) {
|
|
|
6889
|
+ avatar.src = url;
|
|
|
6890
|
+ $("#largeVideo").css("visibility", isMuted ? "hidden" : "visible");
|
|
|
6891
|
+ currentSmallVideo.showAvatar(isMuted);
|
|
|
6892
|
+ }
|
|
|
6893
|
+}
|
|
6955
|
6894
|
|
|
6956
|
6895
|
function changeVideo(isVisible) {
|
|
6957
|
|
- Avatar.updateActiveSpeakerAvatarSrc(currentSmallVideo.peerJid);
|
|
|
6896
|
+ updateActiveSpeakerAvatarSrc();
|
|
6958
|
6897
|
|
|
6959
|
6898
|
APP.RTC.setVideoSrc($('#largeVideo')[0], currentSmallVideo.getSrc());
|
|
6960
|
6899
|
|
|
|
@@ -7001,7 +6940,7 @@ function changeVideo(isVisible) {
|
|
7001
|
6940
|
}
|
|
7002
|
6941
|
|
|
7003
|
6942
|
if(oldSmallVideo)
|
|
7004
|
|
- Avatar.showUserAvatar(oldSmallVideo.peerJid);
|
|
|
6943
|
+ oldSmallVideo.showAvatar();
|
|
7005
|
6944
|
}
|
|
7006
|
6945
|
|
|
7007
|
6946
|
var LargeVideo = {
|
|
|
@@ -7057,10 +6996,9 @@ var LargeVideo = {
|
|
7057
|
6996
|
|
|
7058
|
6997
|
video.fadeOut(300, changeVideo.bind(video, this.isLargeVideoVisible()));
|
|
7059
|
6998
|
} else {
|
|
7060
|
|
- var jid = null;
|
|
7061
|
|
- if(currentSmallVideo)
|
|
7062
|
|
- jid = currentSmallVideo.peerJid;
|
|
7063
|
|
- Avatar.showUserAvatar(jid);
|
|
|
6999
|
+ if(currentSmallVideo) {
|
|
|
7000
|
+ currentSmallVideo.showAvatar();
|
|
|
7001
|
+ }
|
|
7064
|
7002
|
}
|
|
7065
|
7003
|
|
|
7066
|
7004
|
},
|
|
|
@@ -7187,7 +7125,22 @@ var LargeVideo = {
|
|
7187
|
7125
|
getResourceJid: function () {
|
|
7188
|
7126
|
if(!currentSmallVideo)
|
|
7189
|
7127
|
return null;
|
|
7190
|
|
- return currentSmallVideo.peerJid;
|
|
|
7128
|
+ return currentSmallVideo.resourceJid;
|
|
|
7129
|
+ },
|
|
|
7130
|
+ updateAvatar: function (resourceJid) {
|
|
|
7131
|
+ if (resourceJid === this.getResourceJid()) {
|
|
|
7132
|
+ updateActiveSpeakerAvatarSrc();
|
|
|
7133
|
+ }
|
|
|
7134
|
+ },
|
|
|
7135
|
+ showAvatar: function (resourceJid, show) {
|
|
|
7136
|
+ if(this.getResourceJid() === resourceJid
|
|
|
7137
|
+ && LargeVideo.isLargeVideoOnTop())
|
|
|
7138
|
+ {
|
|
|
7139
|
+ $("#largeVideo").css("visibility", show ? "hidden" : "visible");
|
|
|
7140
|
+ $('#activeSpeaker').css("visibility", show ? "visible" : "hidden");
|
|
|
7141
|
+ return true;
|
|
|
7142
|
+ }
|
|
|
7143
|
+ return false;
|
|
7191
|
7144
|
}
|
|
7192
|
7145
|
|
|
7193
|
7146
|
}
|
|
|
@@ -7412,7 +7365,7 @@ LocalVideo.prototype.changeVideo = function (stream, isMuted) {
|
|
7412
|
7365
|
// Add stream ended handler
|
|
7413
|
7366
|
stream.getOriginalStream().onended = function () {
|
|
7414
|
7367
|
localVideoContainer.removeChild(localVideo);
|
|
7415
|
|
- self.VideoLayout.updateRemovedVideo(APP.RTC.getVideoSrc(localVideo));
|
|
|
7368
|
+ self.VideoLayout.updateRemovedVideo(APP.xmpp.myResource());
|
|
7416
|
7369
|
};
|
|
7417
|
7370
|
}
|
|
7418
|
7371
|
|
|
|
@@ -7558,10 +7511,8 @@ RemoteVideo.prototype.removeRemoteStreamElement = function (stream, isVideo, id)
|
|
7558
|
7511
|
return false;
|
|
7559
|
7512
|
|
|
7560
|
7513
|
var select = null;
|
|
7561
|
|
- var removedVideoSrc = null;
|
|
7562
|
7514
|
if (isVideo) {
|
|
7563
|
7515
|
select = $('#' + id);
|
|
7564
|
|
- removedVideoSrc = APP.RTC.getVideoSrc(select.get(0));
|
|
7565
|
7516
|
}
|
|
7566
|
7517
|
else
|
|
7567
|
7518
|
select = $('#' + this.videoSpanId + '>audio');
|
|
|
@@ -7585,8 +7536,8 @@ RemoteVideo.prototype.removeRemoteStreamElement = function (stream, isVideo, id)
|
|
7585
|
7536
|
this.VideoLayout.resizeThumbnails();
|
|
7586
|
7537
|
}
|
|
7587
|
7538
|
|
|
7588
|
|
- if (removedVideoSrc)
|
|
7589
|
|
- this.VideoLayout.updateRemovedVideo(removedVideoSrc);
|
|
|
7539
|
+ if (isVideo)
|
|
|
7540
|
+ this.VideoLayout.updateRemovedVideo(this.resourceJid);
|
|
7590
|
7541
|
};
|
|
7591
|
7542
|
|
|
7592
|
7543
|
RemoteVideo.prototype.addRemoteStreamElement = function (sid, stream, thessrc) {
|
|
|
@@ -7695,7 +7646,7 @@ RemoteVideo.prototype.showPeerContainer = function (state) {
|
|
7695
|
7646
|
$(this.container).show();
|
|
7696
|
7647
|
}
|
|
7697
|
7648
|
|
|
7698
|
|
- Avatar.showUserAvatar(this.peerJid, (state !== 'show'));
|
|
|
7649
|
+ this.showAvatar(state !== 'show');
|
|
7699
|
7650
|
}
|
|
7700
|
7651
|
else if ($(this.container).is(':visible') && isHide)
|
|
7701
|
7652
|
{
|
|
|
@@ -7820,6 +7771,7 @@ RemoteVideo.createContainer = function (spanId) {
|
|
7820
|
7771
|
return remotes.appendChild(container);
|
|
7821
|
7772
|
};
|
|
7822
|
7773
|
|
|
|
7774
|
+
|
|
7823
|
7775
|
module.exports = RemoteVideo;
|
|
7824
|
7776
|
},{"../audio_levels/AudioLevels":10,"../avatar/Avatar":14,"./ConnectionIndicator":32,"./LargeVideo":33,"./SmallVideo":36}],36:[function(require,module,exports){
|
|
7825
|
7777
|
var UIUtil = require("../util/UIUtil");
|
|
|
@@ -7827,6 +7779,13 @@ var LargeVideo = require("./LargeVideo");
|
|
7827
|
7779
|
|
|
7828
|
7780
|
function SmallVideo(){
|
|
7829
|
7781
|
this.isMuted = false;
|
|
|
7782
|
+ this.hasAvatar = false;
|
|
|
7783
|
+}
|
|
|
7784
|
+
|
|
|
7785
|
+function setVisibility(selector, show) {
|
|
|
7786
|
+ if (selector && selector.length > 0) {
|
|
|
7787
|
+ selector.css("visibility", show ? "visible" : "hidden");
|
|
|
7788
|
+ }
|
|
7830
|
7789
|
}
|
|
7831
|
7790
|
|
|
7832
|
7791
|
SmallVideo.prototype.showDisplayName = function(isShow) {
|
|
|
@@ -7973,6 +7932,8 @@ SmallVideo.prototype.showAudioIndicator = function(isMuted) {
|
|
7973
|
7932
|
* Shows video muted indicator over small videos.
|
|
7974
|
7933
|
*/
|
|
7975
|
7934
|
SmallVideo.prototype.showVideoIndicator = function(isMuted) {
|
|
|
7935
|
+ this.showAvatar(isMuted);
|
|
|
7936
|
+
|
|
7976
|
7937
|
var videoMutedSpan = $('#' + this.videoSpanId + '>span.videoMuted');
|
|
7977
|
7938
|
|
|
7978
|
7939
|
if (isMuted === false) {
|
|
|
@@ -8035,6 +7996,8 @@ SmallVideo.prototype.enableDominantSpeaker = function (isEnable)
|
|
8035
|
7996
|
this.container.classList.remove("dominantspeaker");
|
|
8036
|
7997
|
}
|
|
8037
|
7998
|
}
|
|
|
7999
|
+
|
|
|
8000
|
+ this.showAvatar();
|
|
8038
|
8001
|
};
|
|
8039
|
8002
|
|
|
8040
|
8003
|
SmallVideo.prototype.updateIconPositions = function () {
|
|
|
@@ -8106,6 +8069,61 @@ SmallVideo.prototype.hasVideo = function () {
|
|
8106
|
8069
|
return $("#" + this.videoSpanId).find("video").length !== 0;
|
|
8107
|
8070
|
}
|
|
8108
|
8071
|
|
|
|
8072
|
+/**
|
|
|
8073
|
+ * Hides or shows the user's avatar
|
|
|
8074
|
+ * @param show whether we should show the avatar or not
|
|
|
8075
|
+ * video because there is no dominant speaker and no focused speaker
|
|
|
8076
|
+ */
|
|
|
8077
|
+SmallVideo.prototype.showAvatar = function (show) {
|
|
|
8078
|
+ if(!this.hasAvatar)
|
|
|
8079
|
+ return;
|
|
|
8080
|
+
|
|
|
8081
|
+ var video = $('#' + this.videoSpanId).find("video");
|
|
|
8082
|
+ var avatar = $('#avatar_' + this.resourceJid);
|
|
|
8083
|
+
|
|
|
8084
|
+ if (show === undefined || show === null) {
|
|
|
8085
|
+ if(!this.VideoLayout.isInLastN(this.resourceJid)) {
|
|
|
8086
|
+ show = true;
|
|
|
8087
|
+ }
|
|
|
8088
|
+ else
|
|
|
8089
|
+ {
|
|
|
8090
|
+ show = APP.RTC.isVideoMuted(this.peerJid);
|
|
|
8091
|
+ }
|
|
|
8092
|
+
|
|
|
8093
|
+ }
|
|
|
8094
|
+
|
|
|
8095
|
+ if (LargeVideo.showAvatar(this.resourceJid, show))
|
|
|
8096
|
+ {
|
|
|
8097
|
+ setVisibility(avatar, false);
|
|
|
8098
|
+ setVisibility(video, false);
|
|
|
8099
|
+ } else {
|
|
|
8100
|
+ if (video && video.length > 0) {
|
|
|
8101
|
+ setVisibility(video, !show);
|
|
|
8102
|
+ }
|
|
|
8103
|
+ setVisibility(avatar, show);
|
|
|
8104
|
+
|
|
|
8105
|
+ }
|
|
|
8106
|
+}
|
|
|
8107
|
+
|
|
|
8108
|
+SmallVideo.prototype.avatarChanged = function (thumbUrl) {
|
|
|
8109
|
+ var thumbnail = $('#' + this.videoSpanId);
|
|
|
8110
|
+ var avatar = $('#avatar_' + this.resourceJid);
|
|
|
8111
|
+ this.hasAvatar = true;
|
|
|
8112
|
+
|
|
|
8113
|
+ // set the avatar in the thumbnail
|
|
|
8114
|
+ if (avatar && avatar.length > 0) {
|
|
|
8115
|
+ avatar[0].src = thumbUrl;
|
|
|
8116
|
+ } else {
|
|
|
8117
|
+ if (thumbnail && thumbnail.length > 0) {
|
|
|
8118
|
+ avatar = document.createElement('img');
|
|
|
8119
|
+ avatar.id = 'avatar_' + this.resourceJid;
|
|
|
8120
|
+ avatar.className = 'userAvatar';
|
|
|
8121
|
+ avatar.src = thumbUrl;
|
|
|
8122
|
+ thumbnail.append(avatar);
|
|
|
8123
|
+ }
|
|
|
8124
|
+ }
|
|
|
8125
|
+}
|
|
|
8126
|
+
|
|
8109
|
8127
|
module.exports = SmallVideo;
|
|
8110
|
8128
|
},{"../util/UIUtil":31,"./LargeVideo":33}],37:[function(require,module,exports){
|
|
8111
|
8129
|
var AudioLevels = require("../audio_levels/AudioLevels");
|
|
|
@@ -8519,9 +8537,6 @@ var VideoLayout = (function (my) {
|
|
8519
|
8537
|
remoteVideos[resourceJid].enableDominantSpeaker(isEnable);
|
|
8520
|
8538
|
}
|
|
8521
|
8539
|
|
|
8522
|
|
-
|
|
8523
|
|
- Avatar.showUserAvatar(
|
|
8524
|
|
- APP.xmpp.findJidFromResource(resourceJid));
|
|
8525
|
8540
|
};
|
|
8526
|
8541
|
|
|
8527
|
8542
|
/**
|
|
|
@@ -8626,7 +8641,7 @@ var VideoLayout = (function (my) {
|
|
8626
|
8641
|
/**
|
|
8627
|
8642
|
* On audio muted event.
|
|
8628
|
8643
|
*/
|
|
8629
|
|
- $(document).bind('audiomuted.muc', function (event, jid, isMuted) {
|
|
|
8644
|
+ my.onAudioMute = function (jid, isMuted) {
|
|
8630
|
8645
|
var resourceJid = Strophe.getResourceFromJid(jid);
|
|
8631
|
8646
|
if (resourceJid === APP.xmpp.myResource()) {
|
|
8632
|
8647
|
localVideoThumbnail.showAudioIndicator(isMuted);
|
|
|
@@ -8639,24 +8654,22 @@ var VideoLayout = (function (my) {
|
|
8639
|
8654
|
}
|
|
8640
|
8655
|
|
|
8641
|
8656
|
|
|
8642
|
|
- });
|
|
|
8657
|
+ };
|
|
8643
|
8658
|
|
|
8644
|
8659
|
/**
|
|
8645
|
8660
|
* On video muted event.
|
|
8646
|
8661
|
*/
|
|
8647
|
|
- $(document).bind('videomuted.muc', function (event, jid, value) {
|
|
8648
|
|
- var isMuted = (value === "true");
|
|
8649
|
|
- if(jid !== APP.xmpp.myJid() && !APP.RTC.muteRemoteVideoStream(jid, isMuted))
|
|
|
8662
|
+ my.onVideoMute = function (jid, value) {
|
|
|
8663
|
+ if(jid !== APP.xmpp.myJid() && !APP.RTC.muteRemoteVideoStream(jid, value))
|
|
8650
|
8664
|
return;
|
|
8651
|
8665
|
|
|
8652
|
|
- Avatar.showUserAvatar(jid, isMuted);
|
|
8653
|
8666
|
if (jid === APP.xmpp.myJid()) {
|
|
8654
|
|
- localVideoThumbnail.showVideoIndicator(isMuted);
|
|
|
8667
|
+ localVideoThumbnail.showVideoIndicator(value);
|
|
8655
|
8668
|
} else {
|
|
8656
|
8669
|
VideoLayout.ensurePeerContainerExists(jid);
|
|
8657
|
|
- remoteVideos[Strophe.getResourceFromJid(jid)].showVideoIndicator(isMuted);
|
|
|
8670
|
+ remoteVideos[Strophe.getResourceFromJid(jid)].showVideoIndicator(value);
|
|
8658
|
8671
|
}
|
|
8659
|
|
- });
|
|
|
8672
|
+ };
|
|
8660
|
8673
|
|
|
8661
|
8674
|
/**
|
|
8662
|
8675
|
* Display name changed.
|
|
|
@@ -8960,10 +8973,8 @@ var VideoLayout = (function (my) {
|
|
8960
|
8973
|
var smallVideo = VideoLayout.getSmallVideo(focusedVideoResourceJid);
|
|
8961
|
8974
|
if(smallVideo)
|
|
8962
|
8975
|
smallVideo.focus(false);
|
|
8963
|
|
- Avatar.showUserAvatar(
|
|
8964
|
|
- APP.xmpp.findJidFromResource(focusedVideoResourceJid));
|
|
|
8976
|
+ smallVideo.showAvatar();
|
|
8965
|
8977
|
focusedVideoResourceJid = null;
|
|
8966
|
|
-
|
|
8967
|
8978
|
}
|
|
8968
|
8979
|
}
|
|
8969
|
8980
|
|
|
|
@@ -8989,7 +9000,16 @@ var VideoLayout = (function (my) {
|
|
8989
|
9000
|
return null;
|
|
8990
|
9001
|
return remoteVideos[resourceJid];
|
|
8991
|
9002
|
}
|
|
8992
|
|
- }
|
|
|
9003
|
+ };
|
|
|
9004
|
+
|
|
|
9005
|
+ my.userAvatarChanged = function(resourceJid, thumbUrl)
|
|
|
9006
|
+ {
|
|
|
9007
|
+ var smallVideo = VideoLayout.getSmallVideo(resourceJid);
|
|
|
9008
|
+ if(smallVideo)
|
|
|
9009
|
+ smallVideo.avatarChanged(thumbUrl);
|
|
|
9010
|
+ LargeVideo.updateAvatar(resourceJid, thumbUrl);
|
|
|
9011
|
+ };
|
|
|
9012
|
+
|
|
8993
|
9013
|
return my;
|
|
8994
|
9014
|
}(VideoLayout || {}));
|
|
8995
|
9015
|
|
|
|
@@ -14966,13 +14986,17 @@ module.exports = function(XMPP, eventEmitter) {
|
|
14966
|
14986
|
// Parse audio info tag.
|
|
14967
|
14987
|
var audioMuted = $(pres).find('>audiomuted');
|
|
14968
|
14988
|
if (audioMuted.length) {
|
|
14969
|
|
- $(document).trigger('audiomuted.muc', [from, audioMuted.text()]);
|
|
|
14989
|
+ eventEmitter.emit(XMPPEvents.AUDIO_MUTED,
|
|
|
14990
|
+ from, (audioMuted.text() === "true"));
|
|
|
14991
|
+ $(document).trigger('audiomuted.muc', [from, ]);
|
|
14970
|
14992
|
}
|
|
14971
|
14993
|
|
|
14972
|
14994
|
// Parse video info tag.
|
|
14973
|
14995
|
var videoMuted = $(pres).find('>videomuted');
|
|
14974
|
14996
|
if (videoMuted.length) {
|
|
14975
|
|
- $(document).trigger('videomuted.muc', [from, videoMuted.text()]);
|
|
|
14997
|
+ eventEmitter.emit(XMPPEvents.VIDEO_MUTED,
|
|
|
14998
|
+ from, (videoMuted.text() === "true"));
|
|
|
14999
|
+ $(document).trigger('videomuted.muc', [from, ]);
|
|
14976
|
15000
|
}
|
|
14977
|
15001
|
|
|
14978
|
15002
|
var startMuted = $(pres).find('>startmuted');
|
|
|
@@ -28356,7 +28380,9 @@ var XMPPEvents = {
|
|
28356
|
28380
|
DEVICE_AVAILABLE: "xmpp.device_available",
|
|
28357
|
28381
|
START_MUTED: "xmpp.start_muted",
|
|
28358
|
28382
|
PEERCONNECTION_READY: "xmpp.peerconnection_ready",
|
|
28359
|
|
- CONFERENCE_SETUP_FAILED: "xmpp.conference_setup_failed"
|
|
|
28383
|
+ CONFERENCE_SETUP_FAILED: "xmpp.conference_setup_failed",
|
|
|
28384
|
+ AUDIO_MUTED: "xmpp.audio_muted",
|
|
|
28385
|
+ VIDEO_MUTED: "xmpp.video_muted"
|
|
28360
|
28386
|
};
|
|
28361
|
28387
|
module.exports = XMPPEvents;
|
|
28362
|
28388
|
},{}],112:[function(require,module,exports){
|