fix(screenshare): remove redundant event / only show on supported env (#9100)

* remove redundant event / only show on supported env

* remove unused imports
This commit is contained in:
Andrei Gavrilescu 2021-04-28 17:06:41 +03:00 committed by GitHub
parent cf37d34923
commit 6ee868032e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 13 deletions

View File

@ -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);

View File

@ -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

View File

@ -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());
}