Skip to content

Commit

Permalink
feat(ScreenObtainer) add fallback option for Electron
Browse files Browse the repository at this point in the history
If the enclosing Jitsi Meet app declares gDM in Electron is supported,
ignore the `electronUseGetDisplayMedia` config flag and use the gDM
flow. This facilitates having backwards compatibility since the Electron
app won't know if the deployment it's about to join has the gDM flow
support or not.
  • Loading branch information
saghul committed Feb 6, 2025
1 parent b06262d commit 28c1120
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/RTC/ScreenObtainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ const ScreenObtainer = {
* @param {Object} options - Optional parameters.
*/
obtainScreenOnElectron(onSuccess, onFailure, options = {}) {
if (window.JitsiMeetScreenObtainer && window.JitsiMeetScreenObtainer.openDesktopPicker) {
if (typeof window.JitsiMeetScreenObtainer?.openDesktopPicker === 'function') {
// Detect if we have the fallback option.
if (window.JitsiMeetScreenObtainer?.gDMSupported) {
return this.obtainScreenFromGetDisplayMedia(onSuccess, onFailure);
}

const { desktopSharingFrameRate, desktopSharingResolution, desktopSharingSources } = this.options;

window.JitsiMeetScreenObtainer.openDesktopPicker(
Expand Down

0 comments on commit 28c1120

Please sign in to comment.