question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Navigator.MediaDevices.getDisplayMedia() is not present.

See original GitHub issue

Hello,

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:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kim3ercommented, Sep 2, 2021

Looks like getDisplayMedia is included in the current build of the main branch.

getdisplaymedia

1reaction
SgAkErRucommented, Jul 4, 2021

But https://github.com/microsoft/TypeScript-DOM-lib-generator#additions also says:

A feature needs to be supported by more than two major browser engines to be included here, to make sure there is a good consensus among vendors: Gecko (Firefox), Blink (Chrome/Edge), and WebKit (Safari).

And about W3C Working Draft:

If it’s at Working draft the additions available in all three of Firefox, Safari and Chromium

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found