mirror of
https://github.com/vector-im/element-web.git
synced 2024-12-02 17:36:44 +08:00
Rename audioOnly to videoMuted
This makes more sense and will match a possible mute events MSC Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
346784e530
commit
9324dec0d6
@ -614,7 +614,7 @@ export default class CallView extends React.Component<IProps, IState> {
|
||||
const feeds = this.state.feeds.map((feed, i) => {
|
||||
// Here we check to hide local audio feeds to achieve the same UI/UX
|
||||
// as before. But once again this might be subject to change
|
||||
if (feed.isAudioOnly() && feed.isLocal()) return;
|
||||
if (feed.isVideoMuted() && feed.isLocal()) return;
|
||||
return (
|
||||
<VideoFeed
|
||||
key={i}
|
||||
|
@ -41,7 +41,8 @@ interface IProps {
|
||||
}
|
||||
|
||||
interface IState {
|
||||
audioOnly: boolean;
|
||||
audioMuted: boolean;
|
||||
videoMuted: boolean;
|
||||
}
|
||||
|
||||
|
||||
@ -54,7 +55,8 @@ export default class VideoFeed extends React.Component<IProps, IState> {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
audioOnly: this.props.feed.isAudioOnly(),
|
||||
audioMuted: this.props.feed.isAudioMuted(),
|
||||
videoMuted: this.props.feed.isVideoMuted(),
|
||||
};
|
||||
}
|
||||
|
||||
@ -115,7 +117,10 @@ export default class VideoFeed extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
onNewStream = (newStream: MediaStream) => {
|
||||
this.setState({ audioOnly: this.props.feed.isAudioOnly()});
|
||||
this.setState({
|
||||
audioMuted: this.props.feed.isAudioMuted(),
|
||||
videoMuted: this.props.feed.isVideoMuted(),
|
||||
});
|
||||
const currentMedia = this.getCurrentMedia();
|
||||
currentMedia.srcObject = newStream;
|
||||
currentMedia.play();
|
||||
@ -132,15 +137,15 @@ export default class VideoFeed extends React.Component<IProps, IState> {
|
||||
mx_VideoFeed: true,
|
||||
mx_VideoFeed_local: this.props.feed.isLocal(),
|
||||
mx_VideoFeed_remote: !this.props.feed.isLocal(),
|
||||
mx_VideoFeed_voice: this.state.audioOnly,
|
||||
mx_VideoFeed_video: !this.state.audioOnly,
|
||||
mx_VideoFeed_voice: this.state.videoMuted,
|
||||
mx_VideoFeed_video: !this.state.videoMuted,
|
||||
mx_VideoFeed_mirror: (
|
||||
this.props.feed.isLocal() &&
|
||||
SettingsStore.getValue('VideoView.flipVideoHorizontally')
|
||||
),
|
||||
};
|
||||
|
||||
if (this.state.audioOnly) {
|
||||
if (this.state.videoMuted) {
|
||||
const member = this.props.feed.getMember();
|
||||
const avatarSize = this.props.pipMode ? 76 : 160;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user