Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(watermarks): selectively enable watermarks #15201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions react/features/large-video/components/LargeVideo.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { setTileView } from '../../video-layout/actions.web';
import Whiteboard from '../../whiteboard/components/web/Whiteboard';
import { isWhiteboardEnabled } from '../../whiteboard/functions';
import { setSeeWhatIsBeingShared } from '../actions.web';
import { getLargeVideoParticipant } from '../functions';
import { getLargeVideoParticipant, isWatermarksEnabled } from '../functions';

import ScreenSharePlaceholder from './ScreenSharePlaceholder.web';

Expand Down Expand Up @@ -109,6 +109,11 @@ interface IProps {
*/
_visibleFilmstrip: boolean;

/**
* Whether or not the watermarks are visible.
*/
_watermarksEnabled: boolean;

/**
* Whether or not the whiteboard is ready to be used.
*/
Expand Down Expand Up @@ -193,6 +198,7 @@ class LargeVideo extends Component<IProps> {
_isChatOpen,
_noAutoPlayVideo,
_showDominantSpeakerBadge,
_watermarksEnabled,
_whiteboardEnabled
} = this.props;
const style = this._getCustomStyles();
Expand All @@ -208,7 +214,7 @@ class LargeVideo extends Component<IProps> {
{_whiteboardEnabled && <Whiteboard />}
<div id = 'etherpad' />

<Watermarks />
{ _watermarksEnabled ? <Watermarks /> : <></> }

<div
id = 'dominantSpeaker'
Expand Down Expand Up @@ -378,6 +384,7 @@ function _mapStateToProps(state: IReduxState) {
_verticalFilmstripWidth: verticalFilmstripWidth.current,
_verticalViewMaxWidth: getVerticalViewMaxWidth(state),
_visibleFilmstrip: visible,
_watermarksEnabled: isWatermarksEnabled(state),
_whiteboardEnabled: isWhiteboardEnabled(state)
};
}
Expand Down
13 changes: 13 additions & 0 deletions react/features/large-video/functions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { IReduxState } from '../app/types';
import { getParticipantById } from '../base/participants/functions';
import { getIsLobbyVisible } from '../lobby/functions';
import { isPrejoinPageVisible } from '../prejoin/functions';


/**
* Selector for the participant currently displaying on the large video.
Expand All @@ -12,3 +15,13 @@ export function getLargeVideoParticipant(state: IReduxState) {

return getParticipantById(state, participantId ?? '');
}

/**
* Determines the necessity for watermarks.
*
* @param {IReduxState} state - The redux state.
* @returns {boolean}
*/
export function isWatermarksEnabled(state: IReduxState): boolean {
return !isPrejoinPageVisible(state) && !getIsLobbyVisible(state);
}