ref(StatusIndicators): isScreenSharing -> redux.
This commit is contained in:
parent
b71d92a139
commit
68a0bdce2c
|
@ -19,7 +19,11 @@ import {
|
||||||
getPinnedParticipant,
|
getPinnedParticipant,
|
||||||
pinParticipant
|
pinParticipant
|
||||||
} from '../../../react/features/base/participants';
|
} from '../../../react/features/base/participants';
|
||||||
import { isLocalTrackMuted, isRemoteTrackMuted } from '../../../react/features/base/tracks';
|
import {
|
||||||
|
getTrackByMediaTypeAndParticipant,
|
||||||
|
isLocalTrackMuted,
|
||||||
|
isRemoteTrackMuted
|
||||||
|
} from '../../../react/features/base/tracks';
|
||||||
import { ConnectionIndicator } from '../../../react/features/connection-indicator';
|
import { ConnectionIndicator } from '../../../react/features/connection-indicator';
|
||||||
import { DisplayName } from '../../../react/features/display-name';
|
import { DisplayName } from '../../../react/features/display-name';
|
||||||
import {
|
import {
|
||||||
|
@ -85,7 +89,6 @@ export default class SmallVideo {
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*/
|
*/
|
||||||
constructor(VideoLayout) {
|
constructor(VideoLayout) {
|
||||||
this.isScreenSharing = false;
|
|
||||||
this.videoStream = null;
|
this.videoStream = null;
|
||||||
this.audioStream = null;
|
this.audioStream = null;
|
||||||
this.VideoLayout = VideoLayout;
|
this.VideoLayout = VideoLayout;
|
||||||
|
@ -217,22 +220,6 @@ export default class SmallVideo {
|
||||||
this.updateIndicators();
|
this.updateIndicators();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Shows / hides the screen-share indicator over small videos.
|
|
||||||
*
|
|
||||||
* @param {boolean} isScreenSharing indicates if the screen-share element should be shown
|
|
||||||
* or hidden
|
|
||||||
*/
|
|
||||||
setScreenSharing(isScreenSharing) {
|
|
||||||
if (isScreenSharing === this.isScreenSharing) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.isScreenSharing = isScreenSharing;
|
|
||||||
this.updateView();
|
|
||||||
this.updateStatusBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create or updates the ReactElement for displaying status indicators about
|
* Create or updates the ReactElement for displaying status indicators about
|
||||||
* audio mute, video mute, and moderator status.
|
* audio mute, video mute, and moderator status.
|
||||||
|
@ -250,7 +237,6 @@ export default class SmallVideo {
|
||||||
<Provider store = { APP.store }>
|
<Provider store = { APP.store }>
|
||||||
<I18nextProvider i18n = { i18next }>
|
<I18nextProvider i18n = { i18next }>
|
||||||
<StatusIndicators
|
<StatusIndicators
|
||||||
showScreenShareIndicator = { this.isScreenSharing }
|
|
||||||
participantID = { this.id } />
|
participantID = { this.id } />
|
||||||
</I18nextProvider>
|
</I18nextProvider>
|
||||||
</Provider>,
|
</Provider>,
|
||||||
|
@ -466,18 +452,29 @@ export default class SmallVideo {
|
||||||
* @returns {Object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
computeDisplayModeInput() {
|
computeDisplayModeInput() {
|
||||||
|
let isScreenSharing = false;
|
||||||
|
const state = APP.store.getState();
|
||||||
|
const participant = getParticipantById(state, this.id);
|
||||||
|
|
||||||
|
if (typeof participant !== 'undefined' && !participant.isFakeParticipant && !participant.local) {
|
||||||
|
const tracks = state['features/base/tracks'];
|
||||||
|
const track = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, this.id);
|
||||||
|
|
||||||
|
isScreenSharing = typeof track !== 'undefined' && track.videoType === 'desktop';
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isCurrentlyOnLargeVideo: this.isCurrentlyOnLargeVideo(),
|
isCurrentlyOnLargeVideo: this.isCurrentlyOnLargeVideo(),
|
||||||
isHovered: this._isHovered(),
|
isHovered: this._isHovered(),
|
||||||
isAudioOnly: APP.conference.isAudioOnly(),
|
isAudioOnly: APP.conference.isAudioOnly(),
|
||||||
tileViewActive: shouldDisplayTileView(APP.store.getState()),
|
tileViewActive: shouldDisplayTileView(state),
|
||||||
isVideoPlayable: this.isVideoPlayable(),
|
isVideoPlayable: this.isVideoPlayable(),
|
||||||
hasVideo: Boolean(this.selectVideoElement().length),
|
hasVideo: Boolean(this.selectVideoElement().length),
|
||||||
connectionStatus: APP.conference.getParticipantConnectionStatus(this.id),
|
connectionStatus: APP.conference.getParticipantConnectionStatus(this.id),
|
||||||
mutedWhileDisconnected: this.mutedWhileDisconnected,
|
mutedWhileDisconnected: this.mutedWhileDisconnected,
|
||||||
canPlayEventReceived: this._canPlayEventReceived,
|
canPlayEventReceived: this._canPlayEventReceived,
|
||||||
videoStream: Boolean(this.videoStream),
|
videoStream: Boolean(this.videoStream),
|
||||||
isScreenSharing: this.isScreenSharing,
|
isScreenSharing,
|
||||||
videoStreamMuted: this.videoStream ? this.videoStream.isMuted() : 'no stream'
|
videoStreamMuted: this.videoStream ? this.videoStream.isMuted() : 'no stream'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,7 @@ const VideoLayout = {
|
||||||
// Make sure track's muted state is reflected
|
// Make sure track's muted state is reflected
|
||||||
if (stream.getType() !== 'audio') {
|
if (stream.getType() !== 'audio') {
|
||||||
this.onVideoMute(id);
|
this.onVideoMute(id);
|
||||||
remoteVideo.setScreenSharing(stream.videoType === 'desktop');
|
remoteVideo.updateView();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ const VideoLayout = {
|
||||||
|
|
||||||
if (remoteVideo) {
|
if (remoteVideo) {
|
||||||
remoteVideo.removeRemoteStreamElement(stream);
|
remoteVideo.removeRemoteStreamElement(stream);
|
||||||
remoteVideo.setScreenSharing(false);
|
remoteVideo.updateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updateMutedForNoTracks(id, stream.getType());
|
this.updateMutedForNoTracks(id, stream.getType());
|
||||||
|
@ -474,7 +474,7 @@ const VideoLayout = {
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info('Peer video type changed: ', id, newVideoType);
|
logger.info('Peer video type changed: ', id, newVideoType);
|
||||||
remoteVideo.setScreenSharing(newVideoType === 'desktop');
|
remoteVideo.updateView();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -5,7 +5,7 @@ import React, { Component } from 'react';
|
||||||
import { MEDIA_TYPE } from '../../../base/media';
|
import { MEDIA_TYPE } from '../../../base/media';
|
||||||
import { getLocalParticipant, getParticipantById, PARTICIPANT_ROLE } from '../../../base/participants';
|
import { getLocalParticipant, getParticipantById, PARTICIPANT_ROLE } from '../../../base/participants';
|
||||||
import { connect } from '../../../base/redux';
|
import { connect } from '../../../base/redux';
|
||||||
import { isLocalTrackMuted, isRemoteTrackMuted } from '../../../base/tracks';
|
import { getTrackByMediaTypeAndParticipant, isLocalTrackMuted, isRemoteTrackMuted } from '../../../base/tracks';
|
||||||
import { getCurrentLayout, LAYOUTS } from '../../../video-layout';
|
import { getCurrentLayout, LAYOUTS } from '../../../video-layout';
|
||||||
|
|
||||||
import AudioMutedIndicator from './AudioMutedIndicator';
|
import AudioMutedIndicator from './AudioMutedIndicator';
|
||||||
|
@ -35,16 +35,16 @@ type Props = {
|
||||||
*/
|
*/
|
||||||
_showModeratorIndicator: Boolean,
|
_showModeratorIndicator: Boolean,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates if the screen share indicator should be visible or not.
|
||||||
|
*/
|
||||||
|
_showScreenShareIndicator: Boolean,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if the video muted indicator should be visible or not.
|
* Indicates if the video muted indicator should be visible or not.
|
||||||
*/
|
*/
|
||||||
_showVideoMutedIndicator: Boolean,
|
_showVideoMutedIndicator: Boolean,
|
||||||
|
|
||||||
/**
|
|
||||||
* Indicates if the screen share indicator should be visible or not.
|
|
||||||
*/
|
|
||||||
showScreenShareIndicator: Boolean,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ID of the participant for which the status bar is rendered.
|
* The ID of the participant for which the status bar is rendered.
|
||||||
*/
|
*/
|
||||||
|
@ -68,7 +68,7 @@ class StatusIndicators extends Component<Props> {
|
||||||
_currentLayout,
|
_currentLayout,
|
||||||
_showAudioMutedIndicator,
|
_showAudioMutedIndicator,
|
||||||
_showModeratorIndicator,
|
_showModeratorIndicator,
|
||||||
showScreenShareIndicator,
|
_showScreenShareIndicator,
|
||||||
_showVideoMutedIndicator
|
_showVideoMutedIndicator
|
||||||
} = this.props;
|
} = this.props;
|
||||||
let tooltipPosition;
|
let tooltipPosition;
|
||||||
|
@ -87,7 +87,7 @@ class StatusIndicators extends Component<Props> {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{ _showAudioMutedIndicator ? <AudioMutedIndicator tooltipPosition = { tooltipPosition } /> : null }
|
{ _showAudioMutedIndicator ? <AudioMutedIndicator tooltipPosition = { tooltipPosition } /> : null }
|
||||||
{ showScreenShareIndicator ? <ScreenShareIndicator tooltipPosition = { tooltipPosition } /> : null }
|
{ _showScreenShareIndicator ? <ScreenShareIndicator tooltipPosition = { tooltipPosition } /> : null }
|
||||||
{ _showVideoMutedIndicator ? <VideoMutedIndicator tooltipPosition = { tooltipPosition } /> : null }
|
{ _showVideoMutedIndicator ? <VideoMutedIndicator tooltipPosition = { tooltipPosition } /> : null }
|
||||||
{ _showModeratorIndicator ? <ModeratorIndicator tooltipPosition = { tooltipPosition } /> : null }
|
{ _showModeratorIndicator ? <ModeratorIndicator tooltipPosition = { tooltipPosition } /> : null }
|
||||||
</div>
|
</div>
|
||||||
|
@ -116,11 +116,15 @@ function _mapStateToProps(state, ownProps) {
|
||||||
const tracks = state['features/base/tracks'];
|
const tracks = state['features/base/tracks'];
|
||||||
let isVideoMuted = true;
|
let isVideoMuted = true;
|
||||||
let isAudioMuted = true;
|
let isAudioMuted = true;
|
||||||
|
let isScreenSharing = false;
|
||||||
|
|
||||||
if (participant?.local) {
|
if (participant?.local) {
|
||||||
isVideoMuted = isLocalTrackMuted(tracks, MEDIA_TYPE.VIDEO);
|
isVideoMuted = isLocalTrackMuted(tracks, MEDIA_TYPE.VIDEO);
|
||||||
isAudioMuted = isLocalTrackMuted(tracks, MEDIA_TYPE.AUDIO);
|
isAudioMuted = isLocalTrackMuted(tracks, MEDIA_TYPE.AUDIO);
|
||||||
} else if (!participant?.isFakeParticipant) { // remote participants excluding shared video
|
} else if (!participant?.isFakeParticipant) { // remote participants excluding shared video
|
||||||
|
const track = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, participantID);
|
||||||
|
|
||||||
|
isScreenSharing = typeof track !== 'undefined' && track.videoType === 'desktop';
|
||||||
isVideoMuted = isRemoteTrackMuted(tracks, MEDIA_TYPE.VIDEO, participantID);
|
isVideoMuted = isRemoteTrackMuted(tracks, MEDIA_TYPE.VIDEO, participantID);
|
||||||
isAudioMuted = isRemoteTrackMuted(tracks, MEDIA_TYPE.AUDIO, participantID);
|
isAudioMuted = isRemoteTrackMuted(tracks, MEDIA_TYPE.AUDIO, participantID);
|
||||||
}
|
}
|
||||||
|
@ -130,6 +134,7 @@ function _mapStateToProps(state, ownProps) {
|
||||||
_showAudioMutedIndicator: isAudioMuted,
|
_showAudioMutedIndicator: isAudioMuted,
|
||||||
_showModeratorIndicator:
|
_showModeratorIndicator:
|
||||||
!interfaceConfig.DISABLE_FOCUS_INDICATOR && participant && participant.role === PARTICIPANT_ROLE.MODERATOR,
|
!interfaceConfig.DISABLE_FOCUS_INDICATOR && participant && participant.role === PARTICIPANT_ROLE.MODERATOR,
|
||||||
|
_showScreenShareIndicator: isScreenSharing,
|
||||||
_showVideoMutedIndicator: isVideoMuted
|
_showVideoMutedIndicator: isVideoMuted
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue