thumbnail: remove dead code

Audio streams are automatically played by WebRTC and this won't change, probably
ever. There is no point in having checks and an Audio component which does
nothing.
This commit is contained in:
Saúl Ibarra Corretgé 2019-09-13 12:00:08 +02:00 committed by Saúl Ibarra Corretgé
parent 1b27e331da
commit d1be5742ba
1 changed files with 5 additions and 18 deletions

View File

@ -6,7 +6,7 @@ import type { Dispatch } from 'redux';
import { ColorSchemeRegistry } from '../../../base/color-scheme'; import { ColorSchemeRegistry } from '../../../base/color-scheme';
import { openDialog } from '../../../base/dialog'; import { openDialog } from '../../../base/dialog';
import { MEDIA_TYPE, VIDEO_TYPE, Audio } from '../../../base/media'; import { MEDIA_TYPE, VIDEO_TYPE } from '../../../base/media';
import { import {
PARTICIPANT_ROLE, PARTICIPANT_ROLE,
ParticipantView, ParticipantView,
@ -36,9 +36,9 @@ import VideoMutedIndicator from './VideoMutedIndicator';
type Props = { type Props = {
/** /**
* The Redux representation of the participant's audio track. * Whether local audio (microphone) is muted or not.
*/ */
_audioTrack: Object, _audioMuted: boolean,
/** /**
* The Redux representation of the state "features/large-video". * The Redux representation of the state "features/large-video".
@ -122,7 +122,7 @@ class Thumbnail extends Component<Props> {
*/ */
render() { render() {
const { const {
_audioTrack: audioTrack, _audioMuted: audioMuted,
_largeVideo: largeVideo, _largeVideo: largeVideo,
_onClick, _onClick,
_onShowRemoteVideoMenu, _onShowRemoteVideoMenu,
@ -136,14 +136,6 @@ class Thumbnail extends Component<Props> {
tileView tileView
} = this.props; } = this.props;
// We don't render audio in any of the following:
// 1. The audio (source) is muted. There's no practical reason (that we
// know of, anyway) why we'd want to render it given that it's
// silence (& not even comfort noise).
// 2. The audio is local. If we were to render local audio, the local
// participants would be hearing themselves.
const audioMuted = !audioTrack || audioTrack.muted;
const renderAudio = !audioMuted && !audioTrack.local;
const participantId = participant.id; const participantId = participant.id;
const participantInLargeVideo const participantInLargeVideo
= participantId === largeVideo.participantId; = participantId === largeVideo.participantId;
@ -162,11 +154,6 @@ class Thumbnail extends Component<Props> {
] } ] }
touchFeedback = { false }> touchFeedback = { false }>
{ renderAudio
&& <Audio
stream
= { audioTrack.jitsiTrack.getOriginalStream() } /> }
<ParticipantView <ParticipantView
avatarSize = { AVATAR_SIZE } avatarSize = { AVATAR_SIZE }
disableVideo = { isScreenShare } disableVideo = { isScreenShare }
@ -281,7 +268,7 @@ function _mapStateToProps(state, ownProps) {
const renderModeratorIndicator = !_isEveryoneModerator && participant.role === PARTICIPANT_ROLE.MODERATOR; const renderModeratorIndicator = !_isEveryoneModerator && participant.role === PARTICIPANT_ROLE.MODERATOR;
return { return {
_audioTrack: audioTrack, _audioMuted: audioTrack?.muted ?? true,
_largeVideo: largeVideo, _largeVideo: largeVideo,
_renderDominantSpeakerIndicator: renderDominantSpeakerIndicator, _renderDominantSpeakerIndicator: renderDominantSpeakerIndicator,
_renderModeratorIndicator: renderModeratorIndicator, _renderModeratorIndicator: renderModeratorIndicator,