-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canvas Recording is black. #295
Comments
Please try this demo: Source code is updated as well: Relevant commit: e859926 Added following snippet in the canvas-designer.js#L90 to support white background: context._clearRect = context.clearRect;
context.clearRect = function(x, y, width, height) {
context._clearRect(0, 0, context.canvas.width, context.canvas.height);
fillStyle = 'white';
context.fillRect(0, 0, context.canvas.width, context.canvas.height); // fill white background
} |
Thank you very much, muaz. I use your code and realize record canvas+microphone,and when I finish the recording and play the recording file, its background-color is white. Of course, I also can set to be other color.Thank you again, muaz. |
record canvas to gif, and it's background color is black. |
Hi muaz,
I meet a question in some days that I record the canvas's background is black by record-canvas-drawings.html. by your help, I improve the part code is as follow in record-canvas-drawings.html:
` var recorder;
(function looper() {
//ignore on stopRecording
if (!recorder) return;
var canvas = window.canvasElementToBeRecorded;
var context = window.context;
and in canvas-designer.js, I add a variable window.context is as follow:
var context = getContext('main-canvas'),
tempContext = getContext('temp-canvas');
window.canvasElementToBeRecorded = context.canvas;
window.context = context;
In function looper,if I don’t comment out the code ‘if (!recorder) return;’ and when I finished the recording, recording file’s background-color is still black. But if I comment out the code ‘if (!recorder) return;’ and I can’t write any thing in canvas and I press F12,I can always see the console.log in the loop.
I also have studied your RecordRTC. js, but I have not solved the problem of recording background color. Can you tell my mistake? Looking forward to your reply.
The text was updated successfully, but these errors were encountered: