Update sidebar behaviour
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
74649f1f92
commit
337664a1b4
2 changed files with 15 additions and 6 deletions
|
@ -588,6 +588,8 @@ export default class CallView extends React.Component<IProps, IState> {
|
||||||
const avatarSize = this.props.pipMode ? 76 : 160;
|
const avatarSize = this.props.pipMode ? 76 : 160;
|
||||||
const transfereeCall = CallHandler.sharedInstance().getTransfereeForCallId(this.props.call.callId);
|
const transfereeCall = CallHandler.sharedInstance().getTransfereeForCallId(this.props.call.callId);
|
||||||
const isOnHold = this.state.isLocalOnHold || this.state.isRemoteOnHold;
|
const isOnHold = this.state.isLocalOnHold || this.state.isRemoteOnHold;
|
||||||
|
const isScreensharing = this.props.call.isScreensharing();
|
||||||
|
const sidebarShown = this.state.sidebarShown;
|
||||||
|
|
||||||
let contentView: React.ReactNode;
|
let contentView: React.ReactNode;
|
||||||
let holdTransferContent;
|
let holdTransferContent;
|
||||||
|
@ -638,11 +640,15 @@ export default class CallView extends React.Component<IProps, IState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let sidebar;
|
let sidebar;
|
||||||
if (!isOnHold && !transfereeCall && !this.props.pipMode && this.state.sidebarShown) {
|
if (
|
||||||
|
(!isOnHold && !transfereeCall && !this.props.pipMode) &&
|
||||||
|
(sidebarShown || isScreensharing)
|
||||||
|
) {
|
||||||
sidebar = (
|
sidebar = (
|
||||||
<CallViewSidebar
|
<CallViewSidebar
|
||||||
feeds={this.state.secondaryFeeds}
|
feeds={this.state.secondaryFeeds}
|
||||||
call={this.props.call}
|
call={this.props.call}
|
||||||
|
hideLocalFeeds={isScreensharing && !sidebarShown}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -744,7 +750,7 @@ export default class CallView extends React.Component<IProps, IState> {
|
||||||
mx_CallView_presenting_hidden: !this.state.controlsVisible,
|
mx_CallView_presenting_hidden: !this.state.controlsVisible,
|
||||||
});
|
});
|
||||||
const sharerName = this.state.primaryFeed.getMember().name;
|
const sharerName = this.state.primaryFeed.getMember().name;
|
||||||
let text = this.props.call.isScreensharing()
|
let text = isScreensharing
|
||||||
? _t("You are presenting")
|
? _t("You are presenting")
|
||||||
: _t('%(sharerName)s is presenting', { sharerName });
|
: _t('%(sharerName)s is presenting', { sharerName });
|
||||||
if (!this.state.sidebarShown) {
|
if (!this.state.sidebarShown) {
|
||||||
|
|
|
@ -23,16 +23,19 @@ import { SDPStreamMetadataPurpose } from "matrix-js-sdk/src/webrtc/callEventType
|
||||||
interface IProps {
|
interface IProps {
|
||||||
feeds: Array<CallFeed>;
|
feeds: Array<CallFeed>;
|
||||||
call: MatrixCall;
|
call: MatrixCall;
|
||||||
|
hideLocalFeeds: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class CallViewSidebar extends React.Component<IProps> {
|
export default class CallViewSidebar extends React.Component<IProps> {
|
||||||
render() {
|
render() {
|
||||||
const feeds = this.props.feeds.map((feed) => {
|
const feeds = this.props.feeds.map((feed) => {
|
||||||
// Hide local video feed if video is off
|
// Hide local usermedia feed if video is muted or hide any local feed if we should do so
|
||||||
if (
|
if (
|
||||||
this.props.call.isLocalVideoMuted()
|
feed.isLocal() &&
|
||||||
&& feed.isLocal()
|
(
|
||||||
&& feed.purpose === SDPStreamMetadataPurpose.Usermedia
|
(this.props.call.isLocalVideoMuted() && feed.purpose === SDPStreamMetadataPurpose.Usermedia) ||
|
||||||
|
this.props.hideLocalFeeds
|
||||||
|
)
|
||||||
) return;
|
) return;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue