2

I am trying to use features from the new webcodecs API in Chrome within an angular project. Typescript doesn't seem to be aware of the types, so I installed dom-webcodecs.

https://www.npmjs.com/package/@types/dom-webcodecs

It still seems to be missing VideoDecoder when I build. Here is a stackblitz with a simple example. Am I missing a step to use this in my project? Is there another way to use this API in my project?

https://stackblitz.com/edit/angular-ivy-zzysyg?file=src%2Fapp%2Fapp.component.ts

2 Answers 2

2

While I'm using Nx+Angular, I imagine our solution would be similar. I didn't need "typeRoots": ["node_modules/@types"] in my tsconfig, rather had to add "types": ["dom-webcodecs"] to tsconfig.worker.json.

Sign up to request clarification or add additional context in comments.

Comments

0

if you are using webcodecs Api first u import your browsers types.. like if chrome, try this https://www.npmjs.com/package/@types/chrome or https://www.npmjs.com/package/@types/dom-mediacapture-transform for some that webcodecs api using..

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.