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

mandatory property missing from MediaTrackConstraints #176

Closed
jameshfisher opened this issue Oct 16, 2020 · 1 comment
Closed

mandatory property missing from MediaTrackConstraints #176

jameshfisher opened this issue Oct 16, 2020 · 1 comment

Comments

@jameshfisher
Copy link

Following desktopCapturer docs, I get type errors like:

error TS2322: Type '{ mandatory: { chromeMediaSource: string; chromeMediaSourceId: string; }; }' is not assignable to type 'boolean | MediaTrackConstraints | undefined'.
  Object literal may only specify known properties, and 'mandatory' does not exist in type 'MediaTrackConstraints'.

I've fixed this by adding:

interface MediaTrackConstraints {
    mandatory?: {
        chromeMediaSource: 'desktop',
        chromeMediaSourceId?: string,
    }
}

But I suspect this should be included in Electron's TypeScript defs.

(It actually looks like this API is part of Chrome rather than part of Electron, but then I'm not sure where Chrome-specific type defs should go.)

@jameshfisher
Copy link
Author

Closing in favor of electron/electron#27139

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant