canvas.captureStream() throwing NS_ERROR_NOT_INITIALIZED: error
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
People
(Reporter: grant.patterson, Unassigned)
Details
I couldn't figure out how to reopen the original bug so I cloned it.
https://codepen.io/dbriggs/pen/xxbdrML clearly reproduces this bug. Note that only canvas.getContext('2d') makes captureStream() work; canvas.getContext('3d') does not, which means 3D canvases cannot be captured as streams.
+++ This bug was initially created as a clone of Bug #1572422 +++
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36
Steps to reproduce:
<canvas></canvas>
<script>
var canvasElt = document.querySelector('canvas');
var stream = canvasElt.captureStream();
</script>
Actual results:
NS_ERROR_NOT_INITIALIZED: error was thrown
Expected results:
i should have get MediaStream from this element just like in chrome.
Code is from mozilla developer docs.
Code that works is
<canvas></canvas>
<script>
var canvasElt = document.querySelector('canvas');
var ctx = canvasElt.getContext("2d");
var stream = canvasElt.captureStream();
</script>
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Reporter | ||
Comment 2•4 years ago
|
||
Apologies: canvas.getContext('3d') is not a thing!! canvas.getContext('webgl') is a suitable workaround for this issue if using a webgl canvas.
Updated•3 years ago
|
Description
•