Skip to content

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

feat(media) Disable desktopshare when the video sender limit is reached.

Jaya Allamsetty229e65133c15
diff --git a/lang/main.json b/lang/main.json
index 36eade6cb1..c26dba26d7 100644
--- a/lang/main.json
+++ b/lang/main.json
@@ -638,8 +638,8 @@
"reactionSounds": "Disable sounds",
"reactionSoundsForAll": "Disable sounds for all",
"groupTitle": "Notifications",
- "videoUnmuteBlockedTitle": "Camera unmute blocked!",
- "videoUnmuteBlockedDescription": "Camera unmute operation has been temporarily blocked because of system limits."
+ "videoUnmuteBlockedTitle": "Camera unmute and desktop sharing blocked!",
+ "videoUnmuteBlockedDescription": "Camera unmute and desktop sharing operation have been temporarily blocked because of system limits."
},
"participantsPane": {
"close": "Close",
diff --git a/react/features/base/media/middleware.js b/react/features/base/media/middleware.js
index 004201b343..4a24f42ccd 100644
--- a/react/features/base/media/middleware.js
+++ b/react/features/base/media/middleware.js
@@ -13,6 +13,7 @@ import {
showWarningNotification
} from '../../notifications';
import { isForceMuted } from '../../participants-pane/functions';
+import { isScreenMediaShared } from '../../screen-share';
import { SET_AUDIO_ONLY, setAudioOnly } from '../audio-only';
import { isRoomValid, SET_ROOM } from '../conference';
import { getLocalParticipant } from '../participants';
@@ -114,8 +115,9 @@ MiddlewareRegistry.register(store => next => action => {
const state = store.getState();
const tracks = state['features/base/tracks'];
const isVideoMuted = isLocalTrackMuted(tracks, MEDIA_TYPE.VIDEO);
+ const isMediaShared = isScreenMediaShared(state);
- if (blocked && isVideoMuted) {
+ if (blocked && isVideoMuted && !isMediaShared) {
store.dispatch(showWarningNotification({
descriptionKey: 'notify.videoUnmuteBlockedDescription',
titleKey: 'notify.videoUnmuteBlockedTitle'
diff --git a/react/features/toolbox/components/web/ShareDesktopButton.js b/react/features/toolbox/components/web/ShareDesktopButton.js
index 27631cb5db..85c96eea3e 100644
--- a/react/features/toolbox/components/web/ShareDesktopButton.js
+++ b/react/features/toolbox/components/web/ShareDesktopButton.js
@@ -5,7 +5,7 @@ import { IconShareDesktop } from '../../../base/icons';
import JitsiMeetJS from '../../../base/lib-jitsi-meet/_';
import { connect } from '../../../base/redux';
import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
-import { isScreenVideoShared } from '../../../screen-share';
+import { isScreenMediaShared, isScreenVideoShared } from '../../../screen-share';
type Props = AbstractButtonProps & {
@@ -113,7 +113,13 @@ class ShareDesktopButton extends AbstractButton<Props, *> {
* @returns {Object}
*/
const mapStateToProps = state => {
- let desktopSharingEnabled = JitsiMeetJS.isDesktopSharingEnabled();
+ const { muted, unmuteBlocked } = state['features/base/media'].video;
+ const videoOrShareInProgress = isScreenMediaShared(state) || !muted;
+
+ // Disable the screenshare button if the video sender limit is reached and there is no video or media share in
+ // progress.
+ let desktopSharingEnabled = JitsiMeetJS.isDesktopSharingEnabled()
+ && !(unmuteBlocked && !videoOrShareInProgress);
const { enableFeaturesBasedOnToken } = state['features/base/config'];
let desktopSharingDisabledTooltipKey;