EncodedVideoChunk: copyTo() method
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Note: This feature is available in Dedicated Web Workers.
The copyTo() method of the EncodedVideoChunk interface copies the encoded chunk of video data.
Syntax
js
copyTo(destination)
Parameters
destination-
An
ArrayBuffer, aTypedArray, or aDataViewthat the data can be copied to.
Return value
None (undefined).
Examples
In the following example an EncodedVideoChunk is created then copied.
js
const init = {
type: "key",
data: videoBuffer,
timestamp: 23000000,
duration: 2000000,
};
const chunk = new EncodedVideoChunk(init);
chunk.copyTo(newBuffer);
Specifications
| Specification |
|---|
| WebCodecs> # dom-encodedvideochunk-copyto> |
Browser compatibility
Loading…