VideoColorSpace: toJSON()-Methode

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.

Hinweis: Diese Funktion ist in Dedicated Web Workers verfügbar.

Die toJSON()-Methode der VideoColorSpace-Schnittstelle ist ein Serializer, der eine JSON-Darstellung des VideoColorSpace-Objekts zurückgibt.

Syntax

js
toJSON()

Parameter

Keine.

Rückgabewert

Ein JSON-Objekt.

Beispiele

Im folgenden Beispiel ist colorSpace ein VideoColorSpace-Objekt, das von VideoFrame zurückgegeben wird. Dieses Objekt wird dann als JSON in die Konsole ausgegeben.

js
let colorSpace = VideoFrame.colorSpace;
console.log(colorSpace.toJSON());

Spezifikationen

Specification
WebCodecs
# dom-videocolorspace-tojson

Browser-Kompatibilität