Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTC-15321 - Use setDisplayMediaRequestHandler instead #2266

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/app/chrome-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,15 @@ export const setChromeFlags = () => {
export const setSessionProperties = () => {
logger.info(`chrome-flags: Settings session properties`);
const { customFlags } = config.getConfigFields(['customFlags']) as IConfig;
const { defaultSession } = session;

if (
session.defaultSession &&
defaultSession &&
customFlags &&
customFlags.authServerWhitelist &&
customFlags.authServerWhitelist !== ''
) {
session.defaultSession.allowNTLMCredentialsForDomains(
defaultSession.allowNTLMCredentialsForDomains(
customFlags.authServerWhitelist,
);
}
Expand Down
15 changes: 15 additions & 0 deletions src/app/display-media-request-handler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { session } from 'electron';

export const setDisplayMediaRequestHandler = () => {
const { defaultSession } = session;

defaultSession.setDisplayMediaRequestHandler(
async (_request, _callback) => {
console.log('We are here!');
// const sources = await desktopCapturer.getSources({ types: ['screen', 'window'] })
// callback({ video: sources[0] })
// // Create picker -->
},
{ useSystemPicker: true },
);
};
2 changes: 2 additions & 0 deletions src/app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { ICustomBrowserWindow, windowHandler } from './window-handler';
import { autoLaunchInstance } from './auto-launch-controller';
import { autoUpdate } from './auto-update-handler';
import { presenceStatusStore } from './stores';
import { setDisplayMediaRequestHandler } from './display-media-request-handler';

// Set automatic period substitution to false because of a bug in draft js on the client app
// See https://perzoinc.atlassian.net/browse/SDA-2215 for more details
Expand Down Expand Up @@ -108,6 +109,7 @@ const startApplication = async () => {
// Picks global config values and updates them in the user config
await config.updateUserConfigOnStart();
setSessionProperties();
setDisplayMediaRequestHandler();
await autoUpdate.init();
await windowHandler.createApplication();
logger.info(`main: created application`);
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/desktop-capturer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const getSource = async (
let captureWindow;
let captureScreen;
let id;
const sourcesOpts: string[] = [];
const sourcesOpts: ('window' | 'screen')[] = [];
const { requestId, ...updatedOptions } = options;
if (!isValid(options)) {
callback({
Expand Down
Loading