Closed Bug 1572422 Opened 6 years ago Closed 6 years ago

canvas.captureStream() throwing NS_ERROR_NOT_INITIALIZED: error

Categories

(Firefox :: Untriaged, defect)

68 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1257440

People

(Reporter: badocha.hubert, Unassigned)

Details

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>

Hi Badocha,

Could you please provide us with a test page with the code and the specific steps so we can try to reproduce this issue on our end?

Please also test if this is reproducible in the latest Firefox Nightly version, you can download it from here: https://nightly.mozilla.org/.

If you still have the issue please create a new profile, you have the steps here: https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles?redirectlocale=en-US&redirectslug=Managing-profiles#w_starting-the-profile-manager

Please test if the issue is reproducible in safe mode, here is a link that can help you: https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode

If there is any other info you can provide to help us figure out how we can can reproduce the issue please share them.

Thanks for your contribution.

Flags: needinfo?(badocha.hubert)

i wrote whole page twice in my issue one working on mozzila and chrome and one working only on chrome but taken straight outta mozilla docs. I'll check it on nightly tomorrow

Flags: needinfo?(badocha.hubert)

Hi Badocha,

I wanted to check on this issue. Were you able to test this on Nightly? If the issue persists, please send us the steps we need to follow to reproduce it on our end, and if possible, attach to this ticket screenshots or screen recordings, it'll help us a lot.

Regards,

Flags: needinfo?(badocha.hubert)

Due to the lack of information from the reporter I will close this issue as incomplete, but please reopen it if you have more information that might help us reproduce this issue as well. Thank you

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INCOMPLETE

I'm confused a bit since in my initial report there is code to reproduce the issue.

So i' ll just copy and paste it.

Code according to mozilla developer docs:

<canvas></canvas>
<script>
var canvasElt = document.querySelector('canvas');
var stream = canvasElt.captureStream();
console.log(stream);
</script>

it results in error: NS_ERROR_NOT_INITIALIZED

both in normal firefox and nightly

code that works is

<canvas></canvas>
<script>
var canvasElt = document.querySelector('canvas');
var ctx = canvasElt.getContext("2d");
var stream = canvasElt.captureStream();
console.log(stream);
</script>

so in firefor one nedd to getContext of canvas before capturing stream what is not required in chrome and according to mozzila developer's docs.

Flags: needinfo?(badocha.hubert)

https://www12.zippyshare.com/v/wOrpUXqZ/file.html

here's link to screenshots both in nightly and normal

Just ran into this myself. Here's a repro: https://codepen.io/dbriggs/pen/xxbdrML.

Looks like canvas.captureStream() doesn't work unless you've already called canvas.getContext(). Not sure if this is intended or not.

I also don't understand why it's closed but not fixed.

Resolution: INCOMPLETE → DUPLICATE
You need to log in before you can comment on or make changes to this bug.