As of version 1.0.0, the only way to initialize TVG.Canvas is to have a canvas with a unique ID (or selector path) in the DOM tree. This makes it impossible to use it within a WebWorker or to provide OffscreenCanvas.
This can be resolved by enabling initialization using a canvas element or an OffscreenCanvas instance.
For the time being, I think this limitation can be worked around by using a software renderer and receiving frames as an ArrayBuffer. I plan to explore this possibility and will send a pull request. Some slight architectural changes are required for WebGL and WebGPU.
If you would like this feature added, please leave a reaction or a comment explaining your needs.
As of version 1.0.0, the only way to initialize TVG.Canvas is to have a canvas with a unique ID (or selector path) in the DOM tree. This makes it impossible to use it within a WebWorker or to provide OffscreenCanvas.
This can be resolved by enabling initialization using a canvas element or an OffscreenCanvas instance.
For the time being, I think this limitation can be worked around by using a software renderer and receiving frames as an ArrayBuffer. I plan to explore this possibility and will send a pull request. Some slight architectural changes are required for WebGL and WebGPU.
If you would like this feature added, please leave a reaction or a comment explaining your needs.