Navigator.MediaDevices.getDisplayMedia() is not present.
See original GitHub issueHello,
I’m not sure how to edit the types (I can’t find reference to navigator anywhere), but your output is incorrect. The navigator.mediaDevices
object should have a getDisplayMedia(constraints)
method that returns a Promise<MediaStream
.
See here: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia
This has been an issue in the main typescript library for some time now: https://github.com/microsoft/TypeScript/issues/33232 .
It seems like Typescript’s files are generated by this library. This should be an easy fix for someone who knows what they’re doing. Alternatively, point me to where the navigator.mediaDevices types are defined and I’ll do it myself.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
MediaDevices.getDisplayMedia() - Web APIs | MDN
The MediaDevices interface's getDisplayMedia() method prompts the user to select and grant permission to capture the contents of a display ...
Read more >Angular navigator.mediaDevices.getDisplayMedia() does not ...
... to get the screen of the user, I use navigator.mediaDevices.getDisplayMedia() but apparently it does not exist on type "MediaDevices".
Read more >Screen Capture - W3C
The following example demonstrates a request for display capture using the navigator.mediaDevices.getDisplayMedia method defined in this ...
Read more >Q: Since navigator.mediaDevices.getDisplayMedia is only available ...
mediaDevices.getDisplayMedia is only available on some desktop browsers. ... had issues with the orientation with the original class, that is not the issue....
Read more >Better screen sharing with Conditional Focus
Conditional Focus is available from Chrome 109. ... The answer depends on the reason for calling getDisplayMedia() ... await navigator.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looks like
getDisplayMedia
is included in the current build of the main branch.But https://github.com/microsoft/TypeScript-DOM-lib-generator#additions also says:
And about W3C Working Draft:
But according to Mozilla MDN (https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia) this feature supported by all of these browsers since end of 2019.