Skip to content

navigator.mediaDevices should have getDisplayMedia #33232

Closed
@sainnr

Description

@sainnr

TypeScript Version: Version 3.7.0-dev.20190904, also 3.6.2

Search Terms: web api, media devices, display media, screen capture, navigator, types

Code

const opts = { audio: false, video: true }
navigator.mediaDevices.getDisplayMedia(opts) // TS2339: Property 'getDisplayMedia' does not exist on type 'MediaDevices'.

per lib.dom.d.ts, MediaDevices has getUserMedia but not getDisplayMedia. also: https://github.com/Microsoft/TypeScript/blob/master/src/lib/dom.generated.d.ts#L10201

Expected behavior:
getDisplayMedia should be present on MediaDevices, according to w3c/mediacapture-screen-share#86

Actual behavior:
getDisplayMedia is missing on MediaDevices

Playground Link:
https://www.typescriptlang.org/play/#code/MYewdgzgLgBCAOUIwLwwN4wIYFcAmAliAFwwBmWANhAKYA0MAbgXjSTFAE440wC+AKDBZmAcyxQQnAHQBbGoSwARGs2A0I00TShKCEeJSwBPALIKCWABQIkASiA

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions