Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(share-video): Hide element when not shown on large. (#15507)

Дамян Минков0973081fea38
diff --git a/react/features/shared-video/components/web/SharedVideo.tsx b/react/features/shared-video/components/web/SharedVideo.tsx
index e277728ec6..5db45ed685 100644
--- a/react/features/shared-video/components/web/SharedVideo.tsx
+++ b/react/features/shared-video/components/web/SharedVideo.tsx
@@ -4,9 +4,11 @@ import { connect } from 'react-redux';
// @ts-expect-error
import Filmstrip from '../../../../../modules/UI/videolayout/Filmstrip';
import { IReduxState } from '../../../app/types';
+import { FakeParticipant } from '../../../base/participants/types';
import { getVerticalViewMaxWidth } from '../../../filmstrip/functions.web';
+import { getLargeVideoParticipant } from '../../../large-video/functions';
import { getToolboxHeight } from '../../../toolbox/functions.web';
-import { isSharedVideoEnabled } from '../../functions';
+import { isSharedVideoEnabled, isVideoPlaying } from '../../functions';
import VideoManager from './VideoManager';
import YoutubeVideoManager from './YoutubeVideoManager';
@@ -39,10 +41,20 @@ interface IProps {
isEnabled: boolean;
/**
- * Whether or not the user is actively resizing the filmstrip.
+ * Whether the user is actively resizing the filmstrip.
*/
isResizing: boolean;
+ /**
+ * Whether the shared video is currently playing.
+ */
+ isVideoShared: boolean;
+
+ /**
+ * Whether the shared video should be shown on stage.
+ */
+ onStage: boolean;
+
/**
* The shared video url.
*/
@@ -118,17 +130,23 @@ class SharedVideo extends Component<IProps> {
* @returns {React$Element}
*/
render() {
- const { isEnabled, isResizing } = this.props;
+ const { isEnabled, isResizing, isVideoShared, onStage } = this.props;
- if (!isEnabled) {
+ if (!isEnabled || !isVideoShared) {
return null;
}
+ const style: any = this.getDimensions();
+
+ if (!onStage) {
+ style.display = 'none';
+ }
+
return (
<div
className = { (isResizing && 'disable-pointer') || '' }
id = 'sharedVideo'
- style = { this.getDimensions() }>
+ style = { style }>
{this.getManager()}
</div>
);
@@ -147,6 +165,8 @@ function _mapStateToProps(state: IReduxState) {
const { videoUrl } = state['features/shared-video'];
const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
const { visible, isResizing } = state['features/filmstrip'];
+ const onStage = getLargeVideoParticipant(state)?.fakeParticipant === FakeParticipant.SharedVideo;
+ const isVideoShared = isVideoPlaying(state);
return {
clientHeight,
@@ -155,6 +175,8 @@ function _mapStateToProps(state: IReduxState) {
filmstripWidth: getVerticalViewMaxWidth(state),
isEnabled: isSharedVideoEnabled(state),
isResizing,
+ isVideoShared,
+ onStage,
videoUrl
};
}
diff --git a/react/features/shared-video/functions.ts b/react/features/shared-video/functions.ts
index 597198c54a..b96c7ec1f8 100644
--- a/react/features/shared-video/functions.ts
+++ b/react/features/shared-video/functions.ts
@@ -111,16 +111,6 @@ export function isSharedVideoEnabled(stateful: IStateful) {
return !disableThirdPartyRequests;
}
-/**
- * Checks if you youtube URLs should be allowed for shared videos.
- *
- * @param {Array<string>} allowedUrlDomains - The allowed URL domains for shared video.
- * @returns {boolean}
- */
-export function areYoutubeURLsAllowedForSharedVideo(allowedUrlDomains?: Array<string>) {
- return Boolean(allowedUrlDomains?.includes(YOUTUBE_URL_DOMAIN));
-}
-
/**
* Returns true if the passed url is allowed to be used for shared video or not.
*