Removes remoteVideoTypes and uses the set/get in the small video instances.

This commit is contained in:
damencho 2016-03-15 13:36:17 -05:00
parent 3fc839cb37
commit 5837ef506c
1 changed files with 10 additions and 9 deletions

View File

@ -16,7 +16,6 @@ import PanelToggler from "../side_pannels/SidePanelToggler";
const RTCUIUtil = JitsiMeetJS.util.RTCUIHelper; const RTCUIUtil = JitsiMeetJS.util.RTCUIHelper;
var remoteVideos = {}; var remoteVideos = {};
var remoteVideoTypes = {};
var localVideoThumbnail = null; var localVideoThumbnail = null;
var currentDominantSpeaker = null; var currentDominantSpeaker = null;
@ -277,10 +276,11 @@ var VideoLayout = {
/** /**
* Return the type of the remote video. * Return the type of the remote video.
* @param id the id for the remote video * @param id the id for the remote video
* @returns the video type video or screen. * @returns {String} the video type video or screen.
*/ */
getRemoteVideoType (id) { getRemoteVideoType (id) {
return remoteVideoTypes[id]; let smallVideo = VideoLayout.getSmallVideo(id);
return smallVideo ? smallVideo.getVideoType() : null;
}, },
handleVideoThumbClicked (noPinnedEndpointChangedEvent, handleVideoThumbClicked (noPinnedEndpointChangedEvent,
@ -340,10 +340,12 @@ var VideoLayout = {
remoteVideo = new RemoteVideo(id, VideoLayout, eventEmitter); remoteVideo = new RemoteVideo(id, VideoLayout, eventEmitter);
remoteVideos[id] = remoteVideo; remoteVideos[id] = remoteVideo;
let videoType = remoteVideoTypes[id]; let videoType = VideoLayout.getRemoteVideoType(id);
if (videoType) { if (!videoType) {
remoteVideo.setVideoType(videoType); // make video type the default one (camera)
videoType = VideoContainerType;
} }
remoteVideo.setVideoType(videoType);
// In case this is not currently in the last n we don't show it. // In case this is not currently in the last n we don't show it.
if (localLastNCount && localLastNCount > 0 && if (localLastNCount && localLastNCount > 0 &&
@ -754,12 +756,11 @@ var VideoLayout = {
}, },
onVideoTypeChanged (id, newVideoType) { onVideoTypeChanged (id, newVideoType) {
if (remoteVideoTypes[id] === newVideoType) { if (VideoLayout.getRemoteVideoType(id) === newVideoType) {
return; return;
} }
console.info("Peer video type changed: ", id, newVideoType); console.info("Peer video type changed: ", id, newVideoType);
remoteVideoTypes[id] = newVideoType;
var smallVideo; var smallVideo;
if (APP.conference.isLocalId(id)) { if (APP.conference.isLocalId(id)) {
@ -773,8 +774,8 @@ var VideoLayout = {
} else { } else {
return; return;
} }
smallVideo.setVideoType(newVideoType); smallVideo.setVideoType(newVideoType);
if (this.isCurrentlyOnLarge(id)) { if (this.isCurrentlyOnLarge(id)) {
this.updateLargeVideo(id, true); this.updateLargeVideo(id, true);
} }