|
@@ -1,6 +1,6 @@
|
1
|
1
|
var VideoLayout = (function (my) {
|
2
|
2
|
var preMuted = false;
|
3
|
|
- var currentActiveSpeaker = null;
|
|
3
|
+ var currentDominantSpeaker = null;
|
4
|
4
|
|
5
|
5
|
my.changeLocalAudio = function(stream) {
|
6
|
6
|
connection.jingle.localAudio = stream;
|
|
@@ -139,19 +139,19 @@ var VideoLayout = (function (my) {
|
139
|
139
|
|
140
|
140
|
if (isVisible) {
|
141
|
141
|
// Only if the large video is currently visible.
|
142
|
|
- // Disable previous active speaker video.
|
|
142
|
+ // Disable previous dominant speaker video.
|
143
|
143
|
var oldJid = getJidFromVideoSrc(oldSrc);
|
144
|
144
|
if (oldJid) {
|
145
|
145
|
var oldResourceJid = Strophe.getResourceFromJid(oldJid);
|
146
|
|
- VideoLayout.enableActiveSpeaker(oldResourceJid, false);
|
|
146
|
+ VideoLayout.enableDominantSpeaker(oldResourceJid, false);
|
147
|
147
|
}
|
148
|
148
|
|
149
|
|
- // Enable new active speaker in the remote videos section.
|
|
149
|
+ // Enable new dominant speaker in the remote videos section.
|
150
|
150
|
var userJid = getJidFromVideoSrc(newSrc);
|
151
|
151
|
if (userJid)
|
152
|
152
|
{
|
153
|
153
|
var resourceJid = Strophe.getResourceFromJid(userJid);
|
154
|
|
- VideoLayout.enableActiveSpeaker(resourceJid, true);
|
|
154
|
+ VideoLayout.enableDominantSpeaker(resourceJid, true);
|
155
|
155
|
}
|
156
|
156
|
|
157
|
157
|
$(this).fadeIn(300);
|
|
@@ -173,15 +173,15 @@ var VideoLayout = (function (my) {
|
173
|
173
|
if (focusedVideoSrc === videoSrc)
|
174
|
174
|
{
|
175
|
175
|
focusedVideoSrc = null;
|
176
|
|
- var activeSpeakerVideo = null;
|
177
|
|
- // Enable the currently set active speaker.
|
178
|
|
- if (currentActiveSpeaker) {
|
179
|
|
- activeSpeakerVideo
|
180
|
|
- = $('#participant_' + currentActiveSpeaker + '>video')
|
|
176
|
+ var dominantSpeakerVideo = null;
|
|
177
|
+ // Enable the currently set dominant speaker.
|
|
178
|
+ if (currentDominantSpeaker) {
|
|
179
|
+ dominantSpeakerVideo
|
|
180
|
+ = $('#participant_' + currentDominantSpeaker + '>video')
|
181
|
181
|
.get(0);
|
182
|
182
|
|
183
|
|
- if (activeSpeakerVideo)
|
184
|
|
- VideoLayout.updateLargeVideo(activeSpeakerVideo.src, 1);
|
|
183
|
+ if (dominantSpeakerVideo)
|
|
184
|
+ VideoLayout.updateLargeVideo(dominantSpeakerVideo.src, 1);
|
185
|
185
|
}
|
186
|
186
|
|
187
|
187
|
return;
|
|
@@ -254,12 +254,12 @@ var VideoLayout = (function (my) {
|
254
|
254
|
if (isVisible) {
|
255
|
255
|
$('#largeVideo').css({visibility: 'visible'});
|
256
|
256
|
$('.watermark').css({visibility: 'visible'});
|
257
|
|
- VideoLayout.enableActiveSpeaker(resourceJid, true);
|
|
257
|
+ VideoLayout.enableDominantSpeaker(resourceJid, true);
|
258
|
258
|
}
|
259
|
259
|
else {
|
260
|
260
|
$('#largeVideo').css({visibility: 'hidden'});
|
261
|
261
|
$('.watermark').css({visibility: 'hidden'});
|
262
|
|
- VideoLayout.enableActiveSpeaker(resourceJid, false);
|
|
262
|
+ VideoLayout.enableDominantSpeaker(resourceJid, false);
|
263
|
263
|
}
|
264
|
264
|
};
|
265
|
265
|
|
|
@@ -582,20 +582,20 @@ var VideoLayout = (function (my) {
|
582
|
582
|
};
|
583
|
583
|
|
584
|
584
|
/**
|
585
|
|
- * Enables the active speaker UI.
|
|
585
|
+ * Enables the dominant speaker UI.
|
586
|
586
|
*
|
587
|
587
|
* @param resourceJid the jid indicating the video element to
|
588
|
588
|
* activate/deactivate
|
589
|
|
- * @param isEnable indicates if the active speaker should be enabled or
|
|
589
|
+ * @param isEnable indicates if the dominant speaker should be enabled or
|
590
|
590
|
* disabled
|
591
|
591
|
*/
|
592
|
|
- my.enableActiveSpeaker = function(resourceJid, isEnable) {
|
|
592
|
+ my.enableDominantSpeaker = function(resourceJid, isEnable) {
|
593
|
593
|
var displayName = resourceJid;
|
594
|
594
|
var nameSpan = $('#participant_' + resourceJid + '>span.displayname');
|
595
|
595
|
if (nameSpan.length > 0)
|
596
|
596
|
displayName = nameSpan.text();
|
597
|
597
|
|
598
|
|
- console.log("UI enable active speaker",
|
|
598
|
+ console.log("UI enable dominant speaker",
|
599
|
599
|
displayName,
|
600
|
600
|
resourceJid,
|
601
|
601
|
isEnable);
|
|
@@ -625,16 +625,16 @@ var VideoLayout = (function (my) {
|
625
|
625
|
if (isEnable) {
|
626
|
626
|
VideoLayout.showDisplayName(videoContainerId, true);
|
627
|
627
|
|
628
|
|
- if (!videoSpan.classList.contains("activespeaker"))
|
629
|
|
- videoSpan.classList.add("activespeaker");
|
|
628
|
+ if (!videoSpan.classList.contains("dominantspeaker"))
|
|
629
|
+ videoSpan.classList.add("dominantspeaker");
|
630
|
630
|
|
631
|
631
|
video.css({visibility: 'hidden'});
|
632
|
632
|
}
|
633
|
633
|
else {
|
634
|
634
|
VideoLayout.showDisplayName(videoContainerId, false);
|
635
|
635
|
|
636
|
|
- if (videoSpan.classList.contains("activespeaker"))
|
637
|
|
- videoSpan.classList.remove("activespeaker");
|
|
636
|
+ if (videoSpan.classList.contains("dominantspeaker"))
|
|
637
|
+ videoSpan.classList.remove("dominantspeaker");
|
638
|
638
|
|
639
|
639
|
video.css({visibility: 'visible'});
|
640
|
640
|
}
|
|
@@ -805,10 +805,10 @@ var VideoLayout = (function (my) {
|
805
|
805
|
};
|
806
|
806
|
|
807
|
807
|
/**
|
808
|
|
- * Returns the current active speaker resource jid.
|
|
808
|
+ * Returns the current dominant speaker resource jid.
|
809
|
809
|
*/
|
810
|
|
- my.getActiveSpeakerResourceJid = function () {
|
811
|
|
- return currentActiveSpeaker;
|
|
810
|
+ my.getDominantSpeakerResourceJid = function () {
|
|
811
|
+ return currentDominantSpeaker;
|
812
|
812
|
};
|
813
|
813
|
|
814
|
814
|
/**
|
|
@@ -926,21 +926,21 @@ var VideoLayout = (function (my) {
|
926
|
926
|
});
|
927
|
927
|
|
928
|
928
|
/**
|
929
|
|
- * On active speaker changed event.
|
|
929
|
+ * On dominant speaker changed event.
|
930
|
930
|
*/
|
931
|
|
- $(document).bind('activespeakerchanged', function (event, resourceJid) {
|
|
931
|
+ $(document).bind('dominantspeakerchanged', function (event, resourceJid) {
|
932
|
932
|
// We ignore local user events.
|
933
|
933
|
if (resourceJid
|
934
|
934
|
=== Strophe.getResourceFromJid(connection.emuc.myroomjid))
|
935
|
935
|
return;
|
936
|
936
|
|
937
|
|
- // Obtain container for new active speaker.
|
|
937
|
+ // Obtain container for new dominant speaker.
|
938
|
938
|
var container = document.getElementById(
|
939
|
939
|
'participant_' + resourceJid);
|
940
|
940
|
|
941
|
|
- // Update the current active speaker.
|
942
|
|
- if (resourceJid !== currentActiveSpeaker)
|
943
|
|
- currentActiveSpeaker = resourceJid;
|
|
941
|
+ // Update the current dominant speaker.
|
|
942
|
+ if (resourceJid !== currentDominantSpeaker)
|
|
943
|
+ currentDominantSpeaker = resourceJid;
|
944
|
944
|
else
|
945
|
945
|
return;
|
946
|
946
|
|