Reputation: 13
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
Upvotes: 1
Views: 608
Reputation: 11
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..
Upvotes: 0
Reputation: 565
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
.
Upvotes: 1