The CanvasCaptureMediaStreamTrack
interface represents the video track contained in a MediaStream
being generated from a <canvas>
following a call to HTMLCanvasElement.captureStream()
.
Part of the Media Capture and Streams API.
Properties
This interface inherits the properties of its parent, MediaStreamTrack
.
CanvasCaptureMediaStreamTrack.canvas
Read only- Returns the
HTMLCanvasElement
object whose surface is captured in real-time.
Methods
This interface inherits the methods of its parent, MediaStreamTrack
.
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 callingcaptureStream()
.
Specifications
Specification | Status | Comment |
---|---|---|
Media Capture from DOM Elements The definition of 'CanvasCaptureMediaStreamTrack' in that specification. |
Working Draft | Initial definition |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
CanvasCaptureMediaStreamTrack | Chrome Full support 51 | Edge Full support ≤79 | Firefox
Full support
41
| IE No support No | Opera No support No | Safari No support No | WebView Android Full support 51 | Chrome Android Full support 51 | Firefox Android
Full support
41
| Opera Android No support No | Safari iOS No support No | Samsung Internet Android Full support 5.0 |
canvas | Chrome No support No | Edge No support No | Firefox
Full support
41
| IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android
Full support
41
| Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
requestFrame | Chrome Full support 51 | Edge Full support ≤79 | Firefox
Full support
41
| IE No support No | Opera No support No | Safari No support No | WebView Android Full support 51 | Chrome Android Full support 51 | Firefox Android ? | Opera Android No support No | Safari iOS No support No | Samsung Internet Android Full support 5.0 |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
- User must explicitly enable this feature.
- User must explicitly enable this feature.
See also
HTMLCanvasElement.captureStream()
to begin capturing frames from a canvas