Back to Content

CanvasCaptureMediaStreamTrack

files/en-us/web/api/canvascapturemediastreamtrack/index.md

latest1.3 KB
Original Source

{{APIRef("Media Capture and Streams")}}

The CanvasCaptureMediaStreamTrack interface of the {{domxref("Media Capture and Streams API", "", "", "nocode")}} represents the video track contained in a {{domxref("MediaStream")}} being generated from a {{HTMLElement("canvas")}} following a call to {{domxref("HTMLCanvasElement.captureStream()")}}.

{{InheritanceDiagram}}

Instance properties

This interface inherits the properties of its parent, {{domxref("MediaStreamTrack")}}.

  • {{domxref("CanvasCaptureMediaStreamTrack.canvas")}} {{ReadOnlyInline}}
    • : Returns the {{domxref("HTMLCanvasElement")}} object whose surface is captured in real-time.

Instance methods

This interface inherits the methods of its parent, {{domxref("MediaStreamTrack")}}.

  • {{domxref("CanvasCaptureMediaStreamTrack.requestFrame()")}}
    • : Manually forces a frame to be captured and sent to the stream. This lets applications that wish to specify the frame capture times directly do so, if they specified a frameRate of 0 when calling {{domxref("HTMLCanvasElement.captureStream", "captureStream()")}}.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("HTMLCanvasElement.captureStream()")}} to begin capturing frames from a canvas