|
|
@@ -52,10 +52,10 @@ var VideoLayout = (function (my) {
|
|
52
|
52
|
// Add click handler to both video and video wrapper elements in case
|
|
53
|
53
|
// there's no video.
|
|
54
|
54
|
localVideoSelector.click(function () {
|
|
55
|
|
- VideoLayout.handleVideoThumbClicked(RTC.getVideoSrc(localVideo), connection.emuc.myroomjid);
|
|
|
55
|
+ VideoLayout.handleVideoThumbClicked(RTC.getVideoSrc(localVideo), false, connection.emuc.myroomjid);
|
|
56
|
56
|
});
|
|
57
|
57
|
$('#localVideoContainer').click(function () {
|
|
58
|
|
- VideoLayout.handleVideoThumbClicked(RTC.getVideoSrc(localVideo), connection.emuc.myroomjid);
|
|
|
58
|
+ VideoLayout.handleVideoThumbClicked(RTC.getVideoSrc(localVideo), false, connection.emuc.myroomjid);
|
|
59
|
59
|
});
|
|
60
|
60
|
|
|
61
|
61
|
// Add hover handler
|
|
|
@@ -321,7 +321,7 @@ var VideoLayout = (function (my) {
|
|
321
|
321
|
container.addClass("videoContainerFocused");
|
|
322
|
322
|
|
|
323
|
323
|
if (!noPinnedEndpointChangedEvent) {
|
|
324
|
|
- $(document).trigger("pinnedendpointchanged", [userJid]);
|
|
|
324
|
+ $(document).trigger("pinnedendpointchanged", [jid]);
|
|
325
|
325
|
}
|
|
326
|
326
|
}
|
|
327
|
327
|
|
|
|
@@ -530,7 +530,7 @@ var VideoLayout = (function (my) {
|
|
530
|
530
|
var videoThumb = $('#' + container.id + '>video').get(0);
|
|
531
|
531
|
|
|
532
|
532
|
if (videoThumb)
|
|
533
|
|
- VideoLayout.handleVideoThumbClicked(RTC.getVideoSrc(videoThumb), peerJid);
|
|
|
533
|
+ VideoLayout.handleVideoThumbClicked(RTC.getVideoSrc(videoThumb), false, peerJid);
|
|
534
|
534
|
|
|
535
|
535
|
event.preventDefault();
|
|
536
|
536
|
return false;
|
|
|
@@ -1219,22 +1219,6 @@ var VideoLayout = (function (my) {
|
|
1219
|
1219
|
return containerElement.id.substring(i + 12);
|
|
1220
|
1220
|
};
|
|
1221
|
1221
|
|
|
1222
|
|
- my.getLargeVideoResource = function () {
|
|
1223
|
|
- var largeVideoJid, largeVideoResource;
|
|
1224
|
|
-
|
|
1225
|
|
- // Another approach could be to compare the srcs of the thumbnails and
|
|
1226
|
|
- // then call getPeerContainerResourceJid.
|
|
1227
|
|
-
|
|
1228
|
|
- var largeVideoSsrc
|
|
1229
|
|
- = videoSrcToSsrc[$('#largeVideo').attr('src')];
|
|
1230
|
|
-
|
|
1231
|
|
- if (largeVideoSsrc
|
|
1232
|
|
- /* variables/state checking to prevent exceptions */
|
|
1233
|
|
- && (largeVideoJid = ssrc2jid[largeVideoSsrc])
|
|
1234
|
|
- && (largeVideoResource = Strophe.getResourceFromJid(largeVideoJid)))
|
|
1235
|
|
- return largeVideoResource;
|
|
1236
|
|
- };
|
|
1237
|
|
-
|
|
1238
|
1222
|
/**
|
|
1239
|
1223
|
* Adds the remote video menu element for the given <tt>jid</tt> in the
|
|
1240
|
1224
|
* given <tt>parentElement</tt>.
|
|
|
@@ -1337,7 +1321,7 @@ var VideoLayout = (function (my) {
|
|
1337
|
1321
|
// We have a video src, great! Let's update the large video
|
|
1338
|
1322
|
// now.
|
|
1339
|
1323
|
|
|
1340
|
|
- VideoLayout.handleVideoThumbClicked(videoThumb.src);
|
|
|
1324
|
+ VideoLayout.handleVideoThumbClicked(videoThumb.src, false, jid);
|
|
1341
|
1325
|
} else {
|
|
1342
|
1326
|
|
|
1343
|
1327
|
// If we don't have a video src for jid, there's absolutely
|
|
|
@@ -1544,7 +1528,7 @@ var VideoLayout = (function (my) {
|
|
1544
|
1528
|
// it is no longer being received. If resourceJid was being
|
|
1545
|
1529
|
// displayed in the large video we have to switch to another
|
|
1546
|
1530
|
// user.
|
|
1547
|
|
- var largeVideoResource = VideoLayout.getLargeVideoResource();
|
|
|
1531
|
+ var largeVideoResource = largeVideoState.userJid;
|
|
1548
|
1532
|
if (!updateLargeVideo && resourceJid === largeVideoResource) {
|
|
1549
|
1533
|
updateLargeVideo = true;
|
|
1550
|
1534
|
}
|
|
|
@@ -1571,14 +1555,13 @@ var VideoLayout = (function (my) {
|
|
1571
|
1555
|
|
|
1572
|
1556
|
var videoStream = simulcast.getReceivingVideoStream(mediaStream.stream);
|
|
1573
|
1557
|
RTC.attachMediaStream(sel, videoStream);
|
|
1574
|
|
- videoSrcToSsrc[sel.attr('src')] = mediaStream.ssrc;
|
|
1575
|
1558
|
if (lastNPickupJid == mediaStream.peerjid) {
|
|
1576
|
1559
|
// Clean up the lastN pickup jid.
|
|
1577
|
1560
|
lastNPickupJid = null;
|
|
1578
|
1561
|
|
|
1579
|
1562
|
// Don't fire the events again, they've already
|
|
1580
|
1563
|
// been fired in the contact list click handler.
|
|
1581
|
|
- VideoLayout.handleVideoThumbClicked($(sel).attr('src'), false);
|
|
|
1564
|
+ VideoLayout.handleVideoThumbClicked($(sel).attr('src'), false, mediaStream.peerjid);
|
|
1582
|
1565
|
|
|
1583
|
1566
|
updateLargeVideo = false;
|
|
1584
|
1567
|
}
|
|
|
@@ -1725,13 +1708,13 @@ var VideoLayout = (function (my) {
|
|
1725
|
1708
|
|
|
1726
|
1709
|
var updateLargeVideo = (Strophe.getResourceFromJid(ssrc2jid[primarySSRC])
|
|
1727
|
1710
|
== largeVideoState.userJid);
|
|
1728
|
|
- var updateFocusedVideoSrc = (focusedVideoSrc && focusVideoSrc.src && focusVideoSrc.src != '' &&
|
|
|
1711
|
+ var updateFocusedVideoSrc = (focusedVideoSrc && focusedVideoSrc.src && focusedVideoSrc.src != '' &&
|
|
1729
|
1712
|
(RTC.getVideoSrc(selRemoteVideo[0]) == focusedVideoSrc.src));
|
|
1730
|
1713
|
|
|
1731
|
1714
|
var electedStreamUrl;
|
|
1732
|
1715
|
if (largeVideoState.preload_ssrc == primarySSRC)
|
|
1733
|
1716
|
{
|
|
1734
|
|
- RTC.setVideoSrc(selRemoteVideo, RTC.getVideoSrc(largeVideoState.preload[0]));
|
|
|
1717
|
+ RTC.setVideoSrc(selRemoteVideo[0], RTC.getVideoSrc(largeVideoState.preload[0]));
|
|
1735
|
1718
|
}
|
|
1736
|
1719
|
else
|
|
1737
|
1720
|
{
|