Skip to content

dom.lib.ts: MediaDevices.getDisplayMedia is in the wrong place #31821

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

Closed
Spongman opened this issue Jun 7, 2019 · 11 comments
Closed

dom.lib.ts: MediaDevices.getDisplayMedia is in the wrong place #31821

Spongman opened this issue Jun 7, 2019 · 11 comments
Assignees
Labels
Bug A bug in TypeScript

Comments

@Spongman
Copy link

Spongman commented Jun 7, 2019

TypeScript Version: 3.5.1

https://w3c.github.io/mediacapture-screen-share/#mediadevices-additions

in dom.lib.ts navigator.mediaDevices.getDisplayMedia is not found. it looks like it's defined on navigator whereas it should be in the MediaDevices type.

TypeScript/lib/lib.dom.d.ts

Lines 10579 to 10583 in 8705844

interface NavigatorUserMedia {
readonly mediaDevices: MediaDevices;
getDisplayMedia(constraints: MediaStreamConstraints): Promise<MediaStream>;
getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void;
}

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Jun 13, 2019
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.6.0 milestone Jun 13, 2019
@sandersn
Copy link
Member

sandersn commented Jul 26, 2019

Broken since 2.9 (or maybe 2.8, hard to tell where the cutoff is). 79e5e79

@sandersn
Copy link
Member

I'm not sure where this is coming from actually. It's not anywhere in src/lib and a recursive grep of the typescript repo only turns up the one hit for getDisplayMedia (outside tests). I need to look at the code that generates the LKG I guess.

@sandersn
Copy link
Member

This goes away entirely in #32578. That explains why I can't find any mention of it in the source.

@sandersn
Copy link
Member

Closing for now. We can investigate re-adding it under MediaDevices, based on the w3c spec.

@danouche93
Copy link

Hi @sandersn this is a huge issue for us, can you please tell us what is the status of it or a workaround we can use ?? We don't find the getDisplayMedia anywhere

@sandersn
Copy link
Member

sandersn commented Apr 1, 2020

It's been a while since I looked at this, so this is a bit of a guess:

  1. getDisplayMedia was in the wrong place.
  2. In July (which was TS 3.7 I think?), getDisplayMedia got deleted entirely.
  3. The next step for a fix is to add MediaDevices to microsoft/TSJS-lib-generator, based on the w3c spec ideally.

@Spongman
Copy link
Author

Spongman commented Apr 2, 2020

How about not closing issues until they, you know, actually get fixed? Then, maybe, they won’t get dropped on the floor like this?

@sandersn
Copy link
Member

sandersn commented Apr 2, 2020

@Spongman you are looking for #33232 I think. This issue tracked getDisplayMedia being in the wrong place.

@Spongman
Copy link
Author

Spongman commented Apr 2, 2020

surely that's a duplicate of this issue?

@danouche93
Copy link

I finally fix the issue by using Javascript instead of typescript

@LuisFelipeMunoz
Copy link

in vue add interfaces in shims-tsx.d.ts
`import Vue, { VNode } from 'vue'

declare global {
namespace JSX {
// tslint:disable no-empty-interface
interface Element extends VNode { }
// tslint:disable no-empty-interface
interface ElementClass extends Vue { }
interface IntrinsicElements {
[elem: string]: any;
}
}
interface MediaDevices {
getDisplayMedia(constraints?: MediaStreamConstraints): Promise;
}

interface MediaTrackConstraintSet {
cursor?: string;
}
}`
this is a temporary solution

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

No branches or pull requests

6 participants