MediaStreamTrackProcessor: MediaStreamTrackProcessor() constructor

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The MediaStreamTrackProcessor() constructor creates a new MediaStreamTrackProcessor object which consumes a MediaStreamTrack object's source and generates a stream of media frames.

Syntax

new MediaStreamTrackProcessor(options)

Parameters

options

An object with the following properties:

track

A MediaStreamTrack.

maxBufferSize Optional

An integer specifying the maximum number of media frames to be buffered.

Examples

In the following example a new MediaStreamTrackProcessor is created.

const trackProcessor = new MediaStreamTrackProcessor({ track: videoTrack });

Specifications

Specification
MediaStreamTrack Insertable Media Processing using Streams
# dom-mediastreamtrackprocessor-mediastreamtrackprocessor

Browser compatibility

BCD tables only load in the browser