feat: add support for system picker in setDisplayMediaRequestHandler (#43680)
* tmp Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> * feat: add support for system picker in setDisplayMediaRequestHandler Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> * oops Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> * Apply suggestions from code review Co-authored-by: Erick Zhao <erick@hotmail.ca> Co-authored-by: Samuel Attard <sam@electronjs.org> * stuff Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> * well... Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> * seems legit Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> * chore: update patch to handle screenCapturer Co-authored-by: Keeley Hammond <khammond@slack-corp.com> * feat: modify API to use useSystemPicker Co-authored-by: Keeley Hammond <khammond@slack-corp.com> * fix: gate ScreenCaptureKitPicker to macos 15 or higher Co-authored-by: Keeley Hammond <khammond@slack-corp.com> * fix: don't use native picker with legacy media selection Co-authored-by: Keeley Hammond <khammond@slack-corp.com> * chore: code review, boolean set & docs update Co-authored-by: Keeley Hammond <khammond@slack-corp.com> * fix: add cancelCallback Co-authored-by: Keeley Hammond <khammond@slack-corp.com> * docs: clarify session & desktopCapturer docs Co-authored-by: Keeley Hammond <khammond@slack-corp.com> * chore: update patches --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> Co-authored-by: Samuel Attard <sam@electronjs.org> Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
This commit is contained in:
parent
57aeb9dfc6
commit
2aa2611f76
17 changed files with 433 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
import { BrowserWindow } from 'electron/main';
|
||||
const { createDesktopCapturer } = process._linkedBinding('electron_browser_desktop_capturer');
|
||||
const { createDesktopCapturer, isDisplayMediaSystemPickerAvailable } = process._linkedBinding('electron_browser_desktop_capturer');
|
||||
|
||||
const deepEqual = (a: ElectronInternal.GetSourcesOptions, b: ElectronInternal.GetSourcesOptions) => JSON.stringify(a) === JSON.stringify(b);
|
||||
|
||||
|
@ -13,6 +13,8 @@ function isValid (options: Electron.SourcesOptions) {
|
|||
return Array.isArray(options?.types);
|
||||
}
|
||||
|
||||
export { isDisplayMediaSystemPickerAvailable };
|
||||
|
||||
export async function getSources (args: Electron.SourcesOptions) {
|
||||
if (!isValid(args)) throw new Error('Invalid options');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue