This commit is contained in:
Pawel Domas 2021-08-23 09:14:08 -05:00
parent e8e2b20758
commit 30a22254ab
3 changed files with 36 additions and 6 deletions

View File

@ -352,6 +352,12 @@ export function getLocalCameraTrack(tracks) {
.find(t => t.videoType === VIDEO_TYPE.CAMERA);
}
// eslint-disable-next-line require-jsdoc
export function getLocalScreenTrack(tracks) {
return getLocalTracks(tracks, false)
.find(t => t.videoType === VIDEO_TYPE.DESKTOP);
}
/**
* Returns the media type of the local video, presenter or video.
*
@ -405,6 +411,24 @@ export function getTrackByMediaTypeAndParticipant(
);
}
// eslint-disable-next-line require-jsdoc
export function getParticipantsCameraTrack(tracks, participantId) {
return tracks.find(
t => Boolean(t.jitsiTrack)
&& t.participantId === participantId
&& (t.videoType === undefined || t.videoType === VIDEO_TYPE.CAMERA)
);
}
// eslint-disable-next-line require-jsdoc
export function getParticipantsScreenTrack(tracks, participantId) {
return tracks.find(
t => Boolean(t.jitsiTrack)
&& t.participantId === participantId
&& t.videoType === VIDEO_TYPE.DESKTOP
);
}
// eslint-disable-next-line require-jsdoc
export function getLastTrackByMediaTypeAndParticipant(
tracks,

View File

@ -18,7 +18,10 @@ import { ASPECT_RATIO_NARROW } from '../../../base/responsive-ui/constants';
import { isTestModeEnabled } from '../../../base/testing';
import {
getLocalAudioTrack,
getLocalVideoTrack,
getLocalCameraTrack,
getLocalScreenTrack,
getParticipantsCameraTrack,
getParticipantsScreenTrack,
getTrackByMediaTypeAndParticipant,
updateLastTrackVideoMediaEvent
} from '../../../base/tracks';
@ -192,7 +195,9 @@ export type Props = {|
/**
* Styles that will be set to the Thumbnail's main span element.
*/
style?: ?Object
style?: ?Object,
_hasOnlyScreenStream: boolean,
|};
const defaultStyles = theme => {
@ -369,14 +374,14 @@ class Thumbnail extends Component<Props, State> {
const {
_currentLayout,
_isAudioOnly,
_isScreenSharing
_videoTrack
} = this.props;
const { displayMode } = this.state;
const tileViewActive = _currentLayout === LAYOUTS.TILE_VIEW;
if (!(DISPLAY_VIDEO === displayMode)
&& tileViewActive
&& _isScreenSharing
&& _videoTrack && _videoTrack.videoType === VIDEO_TYPE.DESKTOP
&& !_isAudioOnly) {
sendAnalytics(createScreenSharingIssueEvent({
source: 'thumbnail',
@ -969,6 +974,7 @@ function _mapStateToProps(state, ownProps): Object {
_isMobile,
_isMobilePortrait,
_isScreenSharing: _videoTrack?.videoType === 'desktop',
_hasOnlyScreenStream: Boolean(_screenTrack) && !_cameraTrack,
_isTestModeEnabled: isTestModeEnabled(state),
_isVideoPlayable: id && isVideoPlayable(state, id),
_localFlipX: Boolean(localFlipX),

View File

@ -295,14 +295,14 @@ export function computeDisplayModeFromInput(input: Object) {
const {
isAudioOnly,
isCurrentlyOnLargeVideo,
isScreenSharing,
hasOnlyScreenStream,
canPlayEventReceived,
isRemoteParticipant,
tileViewActive
} = input;
const adjustedIsVideoPlayable = input.isVideoPlayable && (!isRemoteParticipant || canPlayEventReceived);
if (!tileViewActive && isScreenSharing && isRemoteParticipant) {
if (!tileViewActive && hasOnlyScreenStream && isRemoteParticipant) {
return DISPLAY_AVATAR;
} else if (isCurrentlyOnLargeVideo && !tileViewActive) {
// Display name is always and only displayed when user is on the stage