VideoColorSpace.VideoColorSpace()
The VideoColorSpace() constructor creates a new VideoColorSpace object which represents a video color space.
Syntax
new VideoColorSpace(); new VideoColorSpace(init);
Parameters
All values default to null when they are not present.
-
initOptional -
A dictionary object containing the following:
-
primariesOptional -
One of the following strings:
"bt709""bt470bg""smpte170m"
-
transferOptional -
One of the following strings:
"bt709""smpte170m""iec61966-2-1"
-
matrixOptional -
One of the following strings:
"rgb""bt709""bt470bg""smpte170m"
-
fullRangeOptional -
A
Boolean,trueif full-range color values are used in the video.
-
Examples
The following example creates a new VideoColorSpace object with VideoColorSpace.primaries set to "bt709", and VideoColorSpace.primaries set to true.
let options = { primaries: "bt709", fullRange: true } let colorSpace = new VideoColorSpace(options); console.log(colorSpace);
Specifications
| Specification |
|---|
| WebCodecs # dom-videocolorspace-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 |
© 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/VideoColorSpace