VideoColorSpace
Baseline
2024
Newly available
Since September 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Want more support for this feature? Tell us why.
Note: This feature is available in Dedicated Web Workers.
The VideoColorSpace interface of the WebCodecs API represents the color space of a video.
Constructor
VideoColorSpace()-
Creates a new
VideoColorSpaceobject.
Instance properties
VideoColorSpace.primariesRead only-
A string containing the color primary describing the color gamut of a video sample.
VideoColorSpace.transfer-
A string containing the transfer characteristics of video samples.
VideoColorSpace.matrix-
A string containing the matrix coefficients describing the relationship between sample component values and color coordinates.
VideoColorSpace.fullRange-
A
Boolean. Iftrueindicates that full-range color values are used.
Instance methods
VideoColorSpace.toJSON()-
Returns a JSON representation of the
VideoColorSpaceobject.
Examples
In the following example, colorSpace is a VideoColorSpace object returned from VideoFrame. The object is then printed to the console.
let colorSpace = VideoFrame.colorSpace;
console.log(colorSpace);
Specifications
| Specification |
|---|
| WebCodecs> # videocolorspace> |