Skip to content

Cannot find name 'MediaRecorder'. #34728

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
leishenglin opened this issue Oct 25, 2019 · 12 comments
Closed

Cannot find name 'MediaRecorder'. #34728

leishenglin opened this issue Oct 25, 2019 · 12 comments
Labels
Unactionable There isn't something we can do with this issue

Comments

@leishenglin
Copy link

image

@AviVahl
Copy link

AviVahl commented Oct 25, 2019

You can get types for MediaRecorder by installing the types package:
@types/dom-mediacapture-record

On another note (personal opinion here), it's quite disrespectful to open such an issue. The "New Issue" page explicitly states that questions go to Stack Overflow. If you believe this to be a bug, there's an entire bug template which you've ignored and replaced with an image. Help others help you.

@RyanCavanaugh RyanCavanaugh added the Unactionable There isn't something we can do with this issue label Oct 30, 2019
@RyanCavanaugh
Copy link
Member

image

@timmywil
Copy link

timmywil commented Mar 11, 2020

While I completely agree with following issue templates, I think it's worth mentioning that this issue is now near the top of search results for "cannot find name MediaRecorder". That's how I got here (yes, I could have gone to DefinitelyTyped and checked for MediaRecorder, but sometimes you google things).

Point is, despite being an unactionable issue that probably never should have been opened, it now serves a useful purpose as unintentional documentation, answering the simple question of which package is needed to add types for MediaRecorder.

Sometimes things work out in ways you would not have expected. This is one of the reasons that I am a firm believer in showing appreciation for all issues that aren't obviously spam. So thanks @leishenglin.

@aislanmaia
Copy link

aislanmaia commented Jul 9, 2020

Now that is really a respectful comment coming from you @timmywil . Congratulations!!!
And thanks @leishenglin I hit the same problem as you.

@ericls
Copy link

ericls commented Aug 20, 2020

How is this unactionable? As a user, if I have access to HTMLElement with no third-party dependencies I would expect MediaRecorder to also be here. In fact, I expected everything stated on this page: https://developer.mozilla.org/en-US/docs/Web/API to be included by default. Why? because everything else I used is included by default, this is how the human brain works. I think an average user encountering this issue would not consider it a question. All the comments saying "please use the template. please post questions to StackOverflow" is like saying "please be happy and not be a loser".

Anyways, here's an actionable suggesting: do a scrape on page: https://developer.mozilla.org/en-US/docs/Web/API, and if there are items not built-in in typescript, change the error message to: "We know this is a built-in browser feature, but we don't have it in typescript by default, please consider installing third-party dependencies".

@robertnicjoo
Copy link

Open tsconfig.js

add following code

"angularCompilerOptions": {
    //......
    "types": [
      "node"
    ]
  }

@padunk
Copy link

padunk commented Feb 7, 2021

How is this unactionable? As a user, if I have access to HTMLElement with no third-party dependencies I would expect MediaRecorder to also be here. In fact, I expected everything stated on this page: https://developer.mozilla.org/en-US/docs/Web/API to be included by default. Why? because everything else I used is included by default, this is how the human brain works. I think an average user encountering this issue would not consider it a question. All the comments saying "please use the template. please post questions to StackOverflow" is like saying "please be happy and not be a loser".

Anyways, here's an actionable suggesting: do a scrape on page: https://developer.mozilla.org/en-US/docs/Web/API, and if there are items not built-in in typescript, change the error message to: "We know this is a built-in browser feature, but we don't have it in typescript by default, please consider installing third-party dependencies".

I second this.
Why MediaRecorder need third party dep? Any reason?
Is it still in Working Draft so we need to install third party dep?
Thanks.

@johnwest80
Copy link

So, this is a workaround, NOT a solution, but to get past this in your code without having to add the dependency, just add this line at the top of your code...

declare var MediaRecorder: any;

@guiseek
Copy link

guiseek commented Sep 5, 2021

it took a long time, but it arrived. now typescript supports MediaRecorder through interfaces

lib.dom.d.ts MediaRecorder

I'm really excited about it.

thank you guys

@guiseek
Copy link

guiseek commented Sep 5, 2021

What is happening?

Captura de Tela 2021-09-05 às 20 55 46

What is happening??!?!

@iliazeus
Copy link

iliazeus commented Sep 6, 2021

@guiseek are you using the same version of TypeScript both in VSCode and the terminal?

@guiseek
Copy link

guiseek commented Sep 30, 2021

@guiseek are you using the same version of TypeScript both in VSCode and the terminal?

@iliazeus Sorry for the delay, from what I saw is the version of the project that hasn't arrived in the supported version yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Unactionable There isn't something we can do with this issue
Projects
None yet
Development

No branches or pull requests