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(screenshare): remove redundant event / only show on supported env (#9100)

Andrei Gavrilescu6ee868032e92
diff --git a/react/features/base/conference/middleware.web.js b/react/features/base/conference/middleware.web.js
index 55f0f2fc7a..c61f657e88 100644
--- a/react/features/base/conference/middleware.web.js
+++ b/react/features/base/conference/middleware.web.js
@@ -1,10 +1,8 @@
// @flow
-import UIEvents from '../../../../service/UI/UIEvents';
import { setPrejoinPageVisibility, setSkipPrejoinOnReload } from '../../prejoin';
import { JitsiConferenceErrors } from '../lib-jitsi-meet';
import { MiddlewareRegistry } from '../redux';
-import { TOGGLE_SCREENSHARING } from '../tracks/actionTypes';
import { CONFERENCE_FAILED, CONFERENCE_JOINED } from './actionTypes';
import './middleware.any';
@@ -30,13 +28,6 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
break;
}
- case TOGGLE_SCREENSHARING: {
- if (typeof APP === 'object') {
- APP.UI.emitEvent(UIEvents.TOGGLE_SCREENSHARING, action.audioOnly);
- }
-
- break;
- }
}
return next(action);
diff --git a/react/features/base/environment/environment.js b/react/features/base/environment/environment.js
index d519d8d678..c62484ffef 100644
--- a/react/features/base/environment/environment.js
+++ b/react/features/base/environment/environment.js
@@ -50,6 +50,15 @@ export function isMacOS() {
return Platform.OS === 'macos';
}
+/**
+ * Returns whether or not the current OS is Windows.
+ *
+ * @returns {boolean}
+ */
+export function isWindows() {
+ return Platform.OS === 'windows';
+}
+
/**
* Returns whether or not the current browser or the list of passed in browsers
* is considered suboptimal. Suboptimal means it is a supported browser but has
diff --git a/react/features/screen-share/functions.js b/react/features/screen-share/functions.js
index e1bccd6e78..401a4aaf0c 100644
--- a/react/features/screen-share/functions.js
+++ b/react/features/screen-share/functions.js
@@ -1,6 +1,6 @@
// @flow
-import { isMacOS } from '../base/environment';
+import { isWindows } from '../base/environment';
import { browser } from '../base/lib-jitsi-meet';
@@ -15,11 +15,11 @@ export function isScreenAudioShared(state: Object) {
}
/**
- * Returns the visibility of the audio only screen share button. Currently electron on mac os doesn't
- * have support for this functionality.
+ * Returns the visibility of the audio only screen share button. Currently only chrome browser and electron on
+ * windows supports this functionality.
*
* @returns {boolean}
*/
export function isScreenAudioSupported() {
- return !(browser.isElectron() && isMacOS());
+ return browser.isChrome() || (browser.isElectron() && isWindows());
}