mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
feat(external_api) facilitate gDM Electron
In order to use gDM in Electron the flow is somewhat reversed. It starts from the Electron main process, so we need an API in the external_api that can trigger the builtin picker. The picker is still necessary.
This commit is contained in:
committed by
Saúl Ibarra Corretgé
parent
ff656f4e6b
commit
13bfdaed68
@@ -75,6 +75,7 @@ import {
|
||||
toggleChat
|
||||
} from '../../react/features/chat/actions';
|
||||
import { openChat } from '../../react/features/chat/actions.web';
|
||||
import { showDesktopPicker } from '../../react/features/desktop-picker/actions';
|
||||
import {
|
||||
processExternalDeviceRequest
|
||||
} from '../../react/features/device-selection/functions';
|
||||
@@ -1048,6 +1049,23 @@ function initCommands() {
|
||||
}
|
||||
case '_new_electron_screensharing_supported': {
|
||||
callback(true);
|
||||
|
||||
break;
|
||||
}
|
||||
case 'open-desktop-picker': {
|
||||
const { desktopSharingSources } = APP.store.getState()['features/base/config'];
|
||||
const options = {
|
||||
desktopSharingSources: desktopSharingSources ?? [ 'screen', 'window' ]
|
||||
};
|
||||
const onSourceChoose = (_streamId, _type, screenShareAudio, source) => {
|
||||
callback({
|
||||
screenShareAudio,
|
||||
source
|
||||
});
|
||||
};
|
||||
|
||||
dispatch(showDesktopPicker(options, onSourceChoose));
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
13
modules/API/external/external_api.js
vendored
13
modules/API/external/external_api.js
vendored
@@ -1243,7 +1243,7 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
|
||||
* @returns {Promise}
|
||||
*
|
||||
* TODO: should be removed after we make sure that all Electron clients use only versions
|
||||
* after with the legacy SS suport was removed from the electron SDK. If we remove it now the SS for Electron
|
||||
* after with the legacy SS support was removed from the electron SDK. If we remove it now the SS for Electron
|
||||
* clients with older versions wont work.
|
||||
*/
|
||||
_isNewElectronScreensharingSupported() {
|
||||
@@ -1455,4 +1455,15 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
|
||||
setVirtualBackground(enabled, backgroundImage) {
|
||||
this.executeCommand('setVirtualBackground', enabled, backgroundImage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the desktop picker. This is invoked by the Electron SDK when gDM is used.
|
||||
*
|
||||
* @returns {Promise}
|
||||
*/
|
||||
_openDesktopPicker() {
|
||||
return this._transport.sendRequest({
|
||||
name: 'open-desktop-picker'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user