Namespace: SpawnDev.SpawnJS.JSObjects
Inheritance: SpawnJSObject -> VideoDecoder
MDN Reference: VideoDecoder - MDN
The VideoDecoder interface of the WebCodecs API decodes encoded video chunks into VideoFrame objects. It provides hardware-accelerated video decoding for real-time applications like video conferencing and game streaming.
| Signature |
Description |
VideoDecoder(SpawnJSObjectReference _ref) |
Deserialization constructor. |
| Property |
Type |
Description |
DecodeQueueSize |
int |
Number of pending decode requests. |
State |
string |
Current state: "unconfigured", "configured", "closed". |
| Method |
Return Type |
Description |
IsConfigSupported(object config) |
Task<object> |
Checks whether the given codec configuration is supported. |
| Method |
Return Type |
Description |
Configure(object config) |
void |
Configures the decoder (codec, coded width/height, etc.). |
Decode(object chunk) |
void |
Decodes an encoded video chunk. |
Flush() |
Task |
Flushes all pending decodes. |
Reset() |
void |
Resets the decoder, discarding pending work. |
Close() |
void |
Closes the decoder permanently. |
| Event |
Type |
Description |
OnDequeue |
ActionEvent<Event> |
Fired when a decode completes and the queue shrinks. |
// Note: WebCodecs decoders are constructed via JS.New with output/error callbacks
// Decoded VideoFrame objects are delivered through the output callback