MediaRecorder does not work on a stream obtained from an invisible canvas.
Reported by
m...@jasonthom.as,
Jun 21 2016
|
||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36
Example URL:
Steps to reproduce the problem:
1.
var canvas = document.createElement('canvas');
var stream = canvas.captureStream(30);
var mr = new MediaRecorder(stream);
mr.ondatavailable = (blob) => {
console.log("Processing Raw Data " + blob.data.size);
}
mr.start(33);
// Draw to canvas
2. Observe callback is never called, and if it is data is empty.
3. Switch 'canvas' for canvas which is in DOM, and visible, and it will work.
What is the expected behavior?
MediaRecorder can record what is being drawn to an invisible canvas.
What went wrong?
MediaRecorder requires canvas to be displayed in order to record.
Did this work before? N/A
Is it a problem with Flash or HTML5? HTML5
Does this work in other browsers? N/A
Chrome version: 51.0.2704.84 Channel: stable
OS Version: 10
Flash Version: Shockwave Flash 22.0 r0
,
Jun 29 2016
Also the same issue can be reproduced using a canvas that is in the DOM that has style="display:none" set.
,
Jul 11 2016
niklase, please help with an owner.
,
Jul 11 2016
This is an expected behavior from both MediaRecorder and CanvasCaptureStream. As canvas that is not attached to DOM (referred as "invisible canvas") does not paint any new frames, nothing gets captured into MediaStream. As a result nothing gets recorded. This behavior is explained in the spec as "A new frame is requested from the canvas when frameCaptureRequested is true and the canvas is painted." When canvas is "invisible", nothing gets painted currently. https://w3c.github.io/mediacapture-fromelement/
,
Jul 25 2016
Marking this bug as "WontFix" per #4. |
||||
►
Sign in to add a comment |
||||
Comment 1 by yini...@chromium.org
, Jun 29 2016