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
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
.