Open
Description
Good evening,
Has data- and audio-visualization been considered as a possible use-case of the PaintWorklet? (both static and real-time audio/data visualization)
Currently, it seems there is no way to communicate with a PaintWorklet from other threads. If a MessagePort or a SharedArrayBuffer could be sent to the PaintWorklet, considerably more options would be available with this API:
let channel = new MessageChannel();
let buffer = new SharedArrayBuffer(1024);
await CSS.paintWorklet.addModule("vis.js");
CSS.paintWorklet.modules["vis.js"].postMessage({
messagePort: channel.port1,
buffer: buffer
}, [channel.port1]);
The other end of the port (or the buffer) could be sent to a worker/worklet thread.
Edit
On second thought, this is a little about being able to draw on a canvas from a worker thread directly, the outcome is very similar.