|
@@ -96,12 +96,22 @@ $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
|
96
|
96
|
}
|
97
|
97
|
var sess = connection.jingle.sessions[sid];
|
98
|
98
|
var vid = document.createElement('video');
|
|
99
|
+ console.log(sess);
|
|
100
|
+ var span = document.createElement('span');
|
|
101
|
+ // FIXME: how to name this span? sess.peerjid is not right for jingle clients
|
|
102
|
+ //console.log('peer: ', Strophe.getResourceFromJid(sess.peerjid));
|
|
103
|
+ //span.id = 'remoteVideocontainer_' + Strophe.getResourceFromJid(sess.peerjid);
|
|
104
|
+ span.className = 'videocontainer';
|
99
|
105
|
var id = 'remoteVideo_' + sid + '_' + data.stream.id;
|
100
|
106
|
vid.id = id;
|
101
|
107
|
vid.autoplay = true;
|
102
|
108
|
vid.oncontextmenu = function () { return false; };
|
103
|
109
|
var remotes = document.getElementById('remoteVideos');
|
104
|
|
- remotes.appendChild(vid);
|
|
110
|
+ span.appendChild(vid);
|
|
111
|
+ if (id.indexOf('mixedmslabel') != -1) {
|
|
112
|
+ $(span).hide();
|
|
113
|
+ }
|
|
114
|
+ remotes.appendChild(span);
|
105
|
115
|
var sel = $('#' + id);
|
106
|
116
|
sel.hide();
|
107
|
117
|
RTC.attachMediaStream(sel, data.stream);
|
|
@@ -109,12 +119,12 @@ $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
|
109
|
119
|
data.stream.onended = function () {
|
110
|
120
|
console.log('stream ended', this.id);
|
111
|
121
|
var src = $('#' + id).attr('src');
|
112
|
|
- $('#' + id).remove();
|
|
122
|
+ $('#' + id).parent().remove();
|
113
|
123
|
if (src === $('#largeVideo').attr('src')) {
|
114
|
124
|
// this is currently displayed as large
|
115
|
125
|
// pick the last visible video in the row
|
116
|
126
|
// if nobody else is left, this picks the local video
|
117
|
|
- var pick = $('#remoteVideos :visible:last').get(0);
|
|
127
|
+ var pick = $('#remoteVideos>span:visible:last>video').get(0);
|
118
|
128
|
// mute if localvideo
|
119
|
129
|
document.getElementById('largeVideo').volume = pick.volume;
|
120
|
130
|
document.getElementById('largeVideo').src = pick.src;
|
|
@@ -269,8 +279,8 @@ function resizeLarge() {
|
269
|
279
|
availableWidth = Math.floor(availableHeight * aspectRatio);
|
270
|
280
|
}
|
271
|
281
|
if (availableWidth < 0 || availableHeight < 0) return;
|
272
|
|
- $('#largeVideo').width(availableWidth);
|
273
|
|
- $('#largeVideo').height(availableWidth / aspectRatio);
|
|
282
|
+ $('#largeVideo').parent().width(availableWidth);
|
|
283
|
+ $('#largeVideo').parent().height(availableWidth / aspectRatio);
|
274
|
284
|
resizeThumbnails();
|
275
|
285
|
}
|
276
|
286
|
|
|
@@ -279,7 +289,7 @@ function resizeThumbnails() {
|
279
|
289
|
// minus 4px for the delimiter lines on the top and bottom of the large video,
|
280
|
290
|
// minus the 36px space inside the remoteVideos container used for highlighting shadow.
|
281
|
291
|
var availableHeight = window.innerHeight - $('#largeVideo').height() - 79;
|
282
|
|
- var numvids = $('#remoteVideos>video:visible').length;
|
|
292
|
+ var numvids = $('#remoteVideos>span:visible').length;
|
283
|
293
|
// Remove the 1px borders arround videos.
|
284
|
294
|
var availableWinWidth = $('#remoteVideos').width() - 2 * numvids;
|
285
|
295
|
var availableWidth = availableWinWidth / numvids;
|
|
@@ -290,9 +300,9 @@ function resizeThumbnails() {
|
290
|
300
|
availableWidth = Math.floor(availableHeight * aspectRatio);
|
291
|
301
|
}
|
292
|
302
|
// size videos so that while keeping AR and max height, we have a nice fit
|
293
|
|
- $('#remoteVideos').height(availableHeight + 36); // add the 2*18px border used for highlighting shadow.
|
294
|
|
- $('#remoteVideos>video:visible').width(availableWidth);
|
295
|
|
- $('#remoteVideos>video:visible').height(availableHeight);
|
|
303
|
+ $('#remoteVideos').height(availableHeight+26); // add the 2*18px-padding-top border used for highlighting shadow.
|
|
304
|
+ $('#remoteVideos>span').width(availableWidth);
|
|
305
|
+ $('#remoteVideos>span').height(availableHeight);
|
296
|
306
|
}
|
297
|
307
|
|
298
|
308
|
$(document).ready(function () {
|