|
|
@@ -16,7 +16,6 @@ import PanelToggler from "../side_pannels/SidePanelToggler";
|
|
16
|
16
|
const RTCUIUtil = JitsiMeetJS.util.RTCUIHelper;
|
|
17
|
17
|
|
|
18
|
18
|
var remoteVideos = {};
|
|
19
|
|
-var remoteVideoTypes = {};
|
|
20
|
19
|
var localVideoThumbnail = null;
|
|
21
|
20
|
|
|
22
|
21
|
var currentDominantSpeaker = null;
|
|
|
@@ -277,10 +276,11 @@ var VideoLayout = {
|
|
277
|
276
|
/**
|
|
278
|
277
|
* Return the type of the remote video.
|
|
279
|
278
|
* @param id the id for the remote video
|
|
280
|
|
- * @returns the video type video or screen.
|
|
|
279
|
+ * @returns {String} the video type video or screen.
|
|
281
|
280
|
*/
|
|
282
|
281
|
getRemoteVideoType (id) {
|
|
283
|
|
- return remoteVideoTypes[id];
|
|
|
282
|
+ let smallVideo = VideoLayout.getSmallVideo(id);
|
|
|
283
|
+ return smallVideo ? smallVideo.getVideoType() : null;
|
|
284
|
284
|
},
|
|
285
|
285
|
|
|
286
|
286
|
handleVideoThumbClicked (noPinnedEndpointChangedEvent,
|
|
|
@@ -326,22 +326,26 @@ var VideoLayout = {
|
|
326
|
326
|
this.updateLargeVideo(resourceJid);
|
|
327
|
327
|
},
|
|
328
|
328
|
|
|
329
|
|
-
|
|
330
|
329
|
/**
|
|
331
|
|
- * Checks if container for participant identified by given id exists
|
|
332
|
|
- * in the document and creates it eventually.
|
|
333
|
|
- *
|
|
334
|
|
- * @return Returns <tt>true</tt> if the peer container exists,
|
|
335
|
|
- * <tt>false</tt> - otherwise
|
|
|
330
|
+ * Creates a remote video for participant for the given id.
|
|
|
331
|
+ * @param id the id of the participant to add
|
|
|
332
|
+ * @param {SmallVideo} smallVideo optional small video instance to add as a
|
|
|
333
|
+ * remote video, if undefined RemoteVideo will be created
|
|
336
|
334
|
*/
|
|
337
|
|
- addParticipantContainer (id) {
|
|
338
|
|
- let remoteVideo = new RemoteVideo(id, VideoLayout, eventEmitter);
|
|
|
335
|
+ addParticipantContainer (id, smallVideo) {
|
|
|
336
|
+ let remoteVideo;
|
|
|
337
|
+ if(smallVideo)
|
|
|
338
|
+ remoteVideo = smallVideo;
|
|
|
339
|
+ else
|
|
|
340
|
+ remoteVideo = new RemoteVideo(id, VideoLayout, eventEmitter);
|
|
339
|
341
|
remoteVideos[id] = remoteVideo;
|
|
340
|
342
|
|
|
341
|
|
- let videoType = remoteVideoTypes[id];
|
|
342
|
|
- if (videoType) {
|
|
343
|
|
- remoteVideo.setVideoType(videoType);
|
|
|
343
|
+ let videoType = VideoLayout.getRemoteVideoType(id);
|
|
|
344
|
+ if (!videoType) {
|
|
|
345
|
+ // make video type the default one (camera)
|
|
|
346
|
+ videoType = VideoContainerType;
|
|
344
|
347
|
}
|
|
|
348
|
+ remoteVideo.setVideoType(videoType);
|
|
345
|
349
|
|
|
346
|
350
|
// In case this is not currently in the last n we don't show it.
|
|
347
|
351
|
if (localLastNCount && localLastNCount > 0 &&
|
|
|
@@ -752,12 +756,11 @@ var VideoLayout = {
|
|
752
|
756
|
},
|
|
753
|
757
|
|
|
754
|
758
|
onVideoTypeChanged (id, newVideoType) {
|
|
755
|
|
- if (remoteVideoTypes[id] === newVideoType) {
|
|
|
759
|
+ if (VideoLayout.getRemoteVideoType(id) === newVideoType) {
|
|
756
|
760
|
return;
|
|
757
|
761
|
}
|
|
758
|
762
|
|
|
759
|
763
|
console.info("Peer video type changed: ", id, newVideoType);
|
|
760
|
|
- remoteVideoTypes[id] = newVideoType;
|
|
761
|
764
|
|
|
762
|
765
|
var smallVideo;
|
|
763
|
766
|
if (APP.conference.isLocalId(id)) {
|
|
|
@@ -771,8 +774,8 @@ var VideoLayout = {
|
|
771
|
774
|
} else {
|
|
772
|
775
|
return;
|
|
773
|
776
|
}
|
|
774
|
|
-
|
|
775
|
777
|
smallVideo.setVideoType(newVideoType);
|
|
|
778
|
+
|
|
776
|
779
|
if (this.isCurrentlyOnLarge(id)) {
|
|
777
|
780
|
this.updateLargeVideo(id, true);
|
|
778
|
781
|
}
|