Closed drewlyton closed 8 months ago
It should certainly be possible. The one tricky bit is that libavjs-webcodecs-polyfill isn't set up to load libav.js itself in Node. libav.js works in Node, but is generally only for testing purposes, since you should use a locally-compiled version in most cases; but then, your request was for testing, so here we are :)
You would need to patch around here ( https://github.com/ennuicastr/libavjs-webcodecs-polyfill/blob/master/src/main.ts#L53 ) to detect if you're in Node, and if so, use require to load libav.js instead. From there, it shouldn't really care, as long as the necessary DOM components (data types for images and canvases and such) are in place.
👋 Hey @Yahweasel,
Do you have an examples of how to use this as a polyfill for jsdom to test WebCodecs code in Node? Tweeted you, but then saw you stopped checking your account. So, I thought I'd try to reach you here.
Excited by the work you're doing!