Skip to content
Function

canEncodeVideo ​

ts
canEncodeVideo(
	codec: 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;
	} & VideoEncodingAdditionalOptions = {},
): Promise<boolean>;

Checks if the browser is able to encode the given video codec with the given parameters.

See VideoCodec, Quality, and VideoEncodingAdditionalOptions.

Released under the Mozilla Public License 2.0.