Note: This feature is available in Dedicated Web Workers.
The VideoColorSpace() constructor creates a new VideoColorSpace object which represents a video color space.
new VideoColorSpace()
new VideoColorSpace(options)All values default to null when they are not present.
options OptionalAn object containing the following:
primaries OptionalOne of the following strings:
"bt709""bt470bg""smpte170m"transfer OptionalOne of the following strings:
"bt709""smpte170m""iec61966-2-1"matrix OptionalOne of the following strings:
"rgb""bt709""bt470bg""smpte170m"fullRange OptionalA Boolean, true if full-range color values are used in the video.
The following example creates a new VideoColorSpace object with VideoColorSpace.primaries set to "bt709", and VideoColorSpace.primaries set to true.
const options = {
primaries: "bt709",
fullRange: true,
};
const colorSpace = new VideoColorSpace(options);
console.log(colorSpace);