Skip to content

Expose types for MediaRecorder API #44397

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
wants to merge 1 commit into from

Conversation

nVitius
Copy link

@nVitius nVitius commented Jun 2, 2021

This PR adds type support for the MediaRecorder API available in all major browsers.
This API is a part of the MediaStream Recorder API. The interfaces for the Media Capture API (MediaStream, etc) are supported by TypeScript already.

There was a request some time ago to add these types but it was closed as unactionable: #34728

The spec for this API can be found here: https://w3c.github.io/mediacapture-record/
MDN Docs for it are here: https://developer.mozilla.org/en-US/docs/Web/API/MediaStream_Recording_API

It would be great to be able to use the types for this API without having to bring in an external dependency.

There is no Backlog issue for this request. I wanted to re-open the discussion around this while also providing the code for it to be fixed.

As a side note, it was kind of difficult to add these in such that they would fit into the rest of the lib.dom.d.ts file. At first glance, it seems to be ordered alphabetically, but that isn't actually the case. There's some kind of grouping applied to the interfaces, but it isn't clear to me what the intention is. Example: all of the *Options and *EventInit interfaces are grouped together alphabetically. Also, it's not clear to me why use a combination of interface with declare var to specify the constructor arguments instead of using declare class. I'm new to using TS though, so I might just be missing something obvious.

@typescript-bot
Copy link
Collaborator

It looks like you've sent a pull request to update our 'lib' files. These files aren't meant to be edited by hand, as they consist of last-known good states of the compiler and are generated from 'src'. Unless this is necessary, consider closing the pull request and sending a separate PR to update 'src'.

@typescript-bot typescript-bot added the lib update PR modifies files in the `lib` folder label Jun 2, 2021
@typescript-bot
Copy link
Collaborator

It looks like you've sent a pull request to update some generated declaration files related to the DOM. These files aren't meant to be edited by hand, as they are synchronized with files in the TSJS-lib-generator repository. You can read more here. For house-keeping purposes, this pull request will be closed.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jun 2, 2021
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@ghost
Copy link

ghost commented Jun 2, 2021

CLA assistant check
All CLA requirements met.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug lib update PR modifies files in the `lib` folder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants