ref(video-layout): add thumbnails on participant join action
This commit is contained in:
parent
60c68b624e
commit
91323ebfec
|
@ -492,9 +492,6 @@ UI.addUser = function(user) {
|
||||||
APP.store.dispatch(showParticipantJoinedNotification(displayName));
|
APP.store.dispatch(showParticipantJoinedNotification(displayName));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add Peer's container
|
|
||||||
VideoLayout.addParticipantContainer(user);
|
|
||||||
|
|
||||||
// Configure avatar
|
// Configure avatar
|
||||||
UI.setUserEmail(id);
|
UI.setUserEmail(id);
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,8 @@ import {
|
||||||
} from '../../../react/features/analytics';
|
} from '../../../react/features/analytics';
|
||||||
import {
|
import {
|
||||||
participantJoined,
|
participantJoined,
|
||||||
participantLeft
|
participantLeft,
|
||||||
|
pinParticipant
|
||||||
} from '../../../react/features/base/participants';
|
} from '../../../react/features/base/participants';
|
||||||
import {
|
import {
|
||||||
dockToolbox,
|
dockToolbox,
|
||||||
|
@ -24,8 +25,6 @@ import {
|
||||||
showToolbox
|
showToolbox
|
||||||
} from '../../../react/features/toolbox';
|
} from '../../../react/features/toolbox';
|
||||||
|
|
||||||
import SharedVideoThumb from './SharedVideoThumb';
|
|
||||||
|
|
||||||
export const SHARED_VIDEO_CONTAINER_TYPE = 'sharedvideo';
|
export const SHARED_VIDEO_CONTAINER_TYPE = 'sharedvideo';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -281,13 +280,6 @@ export default class SharedVideoManager {
|
||||||
|
|
||||||
player.playVideo();
|
player.playVideo();
|
||||||
|
|
||||||
const thumb = new SharedVideoThumb(
|
|
||||||
self.url, SHARED_VIDEO_CONTAINER_TYPE, VideoLayout);
|
|
||||||
|
|
||||||
thumb.setDisplayName('YouTube');
|
|
||||||
VideoLayout.addRemoteVideoContainer(self.url, thumb);
|
|
||||||
VideoLayout.resizeThumbnails(true);
|
|
||||||
|
|
||||||
const iframe = player.getIframe();
|
const iframe = player.getIframe();
|
||||||
|
|
||||||
// eslint-disable-next-line no-use-before-define
|
// eslint-disable-next-line no-use-before-define
|
||||||
|
@ -317,7 +309,7 @@ export default class SharedVideoManager {
|
||||||
name: 'YouTube'
|
name: 'YouTube'
|
||||||
}));
|
}));
|
||||||
|
|
||||||
thumb.videoClick();
|
APP.store.dispatch(pinParticipant(self.url));
|
||||||
|
|
||||||
// If we are sending the command and we are starting the player
|
// If we are sending the command and we are starting the player
|
||||||
// we need to continuously send the player current time position
|
// we need to continuously send the player current time position
|
||||||
|
|
|
@ -6,10 +6,10 @@ const logger = require('jitsi-meet-logger').getLogger(__filename);
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export default function SharedVideoThumb(url, videoType, VideoLayout) {
|
export default function SharedVideoThumb(participant, videoType, VideoLayout) {
|
||||||
this.id = url;
|
this.id = participant.id;
|
||||||
|
|
||||||
this.url = url;
|
this.url = participant.id;
|
||||||
this.setVideoType(videoType);
|
this.setVideoType(videoType);
|
||||||
this.videoSpanId = 'sharedVideoContainer';
|
this.videoSpanId = 'sharedVideoContainer';
|
||||||
this.container = this.createContainer(this.videoSpanId);
|
this.container = this.createContainer(this.videoSpanId);
|
||||||
|
@ -18,6 +18,7 @@ export default function SharedVideoThumb(url, videoType, VideoLayout) {
|
||||||
this.bindHoverHandler();
|
this.bindHoverHandler();
|
||||||
SmallVideo.call(this, VideoLayout);
|
SmallVideo.call(this, VideoLayout);
|
||||||
this.isVideoMuted = true;
|
this.isVideoMuted = true;
|
||||||
|
this.setDisplayName(participant.name);
|
||||||
}
|
}
|
||||||
SharedVideoThumb.prototype = Object.create(SmallVideo.prototype);
|
SharedVideoThumb.prototype = Object.create(SmallVideo.prototype);
|
||||||
SharedVideoThumb.prototype.constructor = SharedVideoThumb;
|
SharedVideoThumb.prototype.constructor = SharedVideoThumb;
|
||||||
|
|
|
@ -9,6 +9,9 @@ import {
|
||||||
pinParticipant
|
pinParticipant
|
||||||
} from '../../../react/features/base/participants';
|
} from '../../../react/features/base/participants';
|
||||||
|
|
||||||
|
import { SHARED_VIDEO_CONTAINER_TYPE } from '../shared_video/SharedVideo';
|
||||||
|
import SharedVideoThumb from '../shared_video/SharedVideoThumb';
|
||||||
|
|
||||||
import Filmstrip from './Filmstrip';
|
import Filmstrip from './Filmstrip';
|
||||||
import UIEvents from '../../../service/UI/UIEvents';
|
import UIEvents from '../../../service/UI/UIEvents';
|
||||||
import UIUtil from '../util/UIUtil';
|
import UIUtil from '../util/UIUtil';
|
||||||
|
@ -16,6 +19,7 @@ import UIUtil from '../util/UIUtil';
|
||||||
import RemoteVideo from './RemoteVideo';
|
import RemoteVideo from './RemoteVideo';
|
||||||
import LargeVideoManager from './LargeVideoManager';
|
import LargeVideoManager from './LargeVideoManager';
|
||||||
import { VIDEO_CONTAINER_TYPE } from './VideoContainer';
|
import { VIDEO_CONTAINER_TYPE } from './VideoContainer';
|
||||||
|
|
||||||
import LocalVideo from './LocalVideo';
|
import LocalVideo from './LocalVideo';
|
||||||
|
|
||||||
const remoteVideos = {};
|
const remoteVideos = {};
|
||||||
|
@ -434,15 +438,32 @@ const VideoLayout = {
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates or adds a participant container for the given id and smallVideo.
|
* Creates a participant container for the given id.
|
||||||
*
|
*
|
||||||
* @param {JitsiParticipant} user the participant to add
|
* @param {Object} participant - The redux representation of a remote
|
||||||
|
* participant.
|
||||||
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
addParticipantContainer(user) {
|
addRemoteParticipantContainer(participant) {
|
||||||
const id = user.getId();
|
if (!participant || participant.local) {
|
||||||
const remoteVideo = new RemoteVideo(user, VideoLayout, eventEmitter);
|
return;
|
||||||
|
} else if (participant.isBot) {
|
||||||
|
const sharedVideoThumb = new SharedVideoThumb(
|
||||||
|
participant,
|
||||||
|
SHARED_VIDEO_CONTAINER_TYPE,
|
||||||
|
VideoLayout);
|
||||||
|
|
||||||
this._setRemoteControlProperties(user, remoteVideo);
|
this.addRemoteVideoContainer(participant.id, sharedVideoThumb);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const id = participant.id;
|
||||||
|
const jitsiParticipant = APP.conference.getParticipantById(id);
|
||||||
|
const remoteVideo
|
||||||
|
= new RemoteVideo(jitsiParticipant, VideoLayout, eventEmitter);
|
||||||
|
|
||||||
|
this._setRemoteControlProperties(jitsiParticipant, remoteVideo);
|
||||||
this.addRemoteVideoContainer(id, remoteVideo);
|
this.addRemoteVideoContainer(id, remoteVideo);
|
||||||
|
|
||||||
this.updateMutedForNoTracks(id, 'audio');
|
this.updateMutedForNoTracks(id, 'audio');
|
||||||
|
|
|
@ -5,9 +5,11 @@ import UIEvents from '../../../service/UI/UIEvents';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DOMINANT_SPEAKER_CHANGED,
|
DOMINANT_SPEAKER_CHANGED,
|
||||||
|
PARTICIPANT_JOINED,
|
||||||
PARTICIPANT_LEFT,
|
PARTICIPANT_LEFT,
|
||||||
PARTICIPANT_UPDATED,
|
PARTICIPANT_UPDATED,
|
||||||
PIN_PARTICIPANT
|
PIN_PARTICIPANT,
|
||||||
|
getParticipantById
|
||||||
} from '../base/participants';
|
} from '../base/participants';
|
||||||
import { MiddlewareRegistry } from '../base/redux';
|
import { MiddlewareRegistry } from '../base/redux';
|
||||||
|
|
||||||
|
@ -28,6 +30,13 @@ MiddlewareRegistry.register(store => next => action => {
|
||||||
const result = next(action);
|
const result = next(action);
|
||||||
|
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
|
case PARTICIPANT_JOINED:
|
||||||
|
if (!action.participant.local) {
|
||||||
|
VideoLayout.addRemoteParticipantContainer(
|
||||||
|
getParticipantById(store.getState(), action.participant.id));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case PARTICIPANT_LEFT:
|
case PARTICIPANT_LEFT:
|
||||||
VideoLayout.removeParticipantContainer(action.participant.id);
|
VideoLayout.removeParticipantContainer(action.participant.id);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue