Skip to content
Function

getFirstEncodableVideoCodec

ts
getFirstEncodableVideoCodec(
	checkedCodecs: VideoCodec[],
	options?: {
		/** The width of the video in pixels. */
		width?: number;
		/** The height of the video in pixels. */
		height?: number;
		/** The desired quality of the encoded video. */
		quality?: Quality;
		/**
		 * The target bitrate for the encoded video, in bits per second. Alternatively, a {@link Quality} can
		 * be provided.
		 * @deprecated Use `quality` instead.
		 */
		bitrate?: number | Quality;
		/** The expected frame rate in frames per second, if known. */
		frameRate?: number;
	},
): Promise<VideoCodec | null>;

Returns the first video codec from the given list that can be encoded by the browser.

See VideoCodec and Quality.

Released under the Mozilla Public License 2.0.