VideoColorSpace
The VideoColorSpace interface of the WebCodecs API represents the color space of a video.
Constructor
VideoColorSpace.VideoColorSpace()-
Creates a new
VideoColorSpaceobject.
Properties
-
VideoColorSpace.primariesRead only -
A
stringcontaining the color primary describing the color gamut of a video sample. VideoColorSpace.transfer-
A
stringcontaining the transfer characteristics of video samples. VideoColorSpace.matrix-
A
stringcontaining 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.
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 |
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
VideoColorSpace |
94 |
94 |
No |
No |
80 |
No |
94 |
94 |
No |
No |
No |
No |
VideoColorSpace |
94 |
94 |
No |
No |
80 |
No |
94 |
94 |
No |
No |
No |
No |
fullRange |
94 |
94 |
No |
No |
80 |
No |
94 |
94 |
No |
No |
No |
No |
matrix |
94 |
94 |
No |
No |
80 |
No |
94 |
94 |
No |
No |
No |
No |
primaries |
94 |
94 |
No |
No |
80 |
No |
94 |
94 |
No |
No |
No |
No |
toJSON |
94 |
94 |
No |
No |
80 |
No |
94 |
94 |
No |
No |
No |
No |
transfer |
94 |
94 |
No |
No |
80 |
No |
94 |
94 |
No |
No |
No |
No |
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/VideoColorSpace