This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The CanvasCaptureMediaStream.requestFrame()
method forces a frame to be captured and sent to the stream. This allows to capture partially rendered frames.
stream.requestFrame();
// Find the canvas element to capture var canvasElt = document.getElementsByTagName("canvas")[0]; // Get the stream var stream = canvasElt.captureStream(25); // 25 FPS // Send the current state of the canvas as a frame to the stream stream.requestFrame();
Specification | Status | Comment |
---|---|---|
Media Capture from DOM Elements The definition of 'CanvasCaptureMediaStream.requestFrame()' in that specification. | Editor's Draft | Initial definition |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | ? | 41 (41)[1] | No support | ? | ? |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | ? | ?[1] | 34.0 (34) | No support | ? | ? |
[1] Disabled by default; set the preference canvas.capturestream.enabled
to true
to activate.
CanvasCaptureMediaStream
, the interface it belongs to.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/CanvasCaptureMediaStream/requestFrame