samdutton / simpl

Simplest possible examples of HTML, CSS and Javascript:
https://simpl.info
Apache License 2.0
5.19k stars 1.64k forks source link

MediaStream Recording sample doesn't work on Firefox 42 #70

Closed soulfly closed 8 years ago

soulfly commented 8 years ago

I just got

 MediaRecorder is not supported by this browser.

 Try Firefox 29 or later, or Chrome 47 or later, with Enable experimental Web Platform features enabled from chrome://flags.

but I use Firefox 42

any ideas?

samdutton commented 8 years ago

Thanks for reporting this.

Not sure what's going wrong... I just tried in Firefox 42 on Mac without any problem.

What OS are you on? What error do you see in the console? Do you get local video OK (in the left-hand video element)?

soulfly commented 8 years ago

I use OS X 10.11.1

 Do you get local video OK (in the left-hand video element)?

yes

here is an exception in log:

 Exception while creating MediaRecorder: TypeError: Argument 2 of MediaRecorder.constructor can't be converted to a dictionary.

 stack trace:
 startRecording@https://simpl.info/mediarecorder/js/main.js:93:21
 toggleRecording@https://simpl.info/mediarecorder/js/main.js:81:5
samdutton commented 8 years ago

Got it — I'd messed around with setting the codec in MediaRecorder constructor and broken it for Firefox.

For the second constructor argument, Firefox requires a dictionary (Object), whereas Chrome accepts a string.

Should be fixed now. Let me know if you still get errors.

Thanks again!

soulfly commented 8 years ago

Still have some issues here https://simpl.info/mediarecorder/

Now it's different

 Created MediaRecorder MediaRecorder { stream: LocalMediaStream, state: "inactive", mimeType: "video/vp9", ondataavailable: null, onerror: null, onstart: null, onstop: null, onwarning: null } with options    Object { mimeType: "video/vp9" } main.js:106:3
 MediaRecorder started MediaRecorder { stream: LocalMediaStream, state: "recording", mimeType: "video/vp9", ondataavailable: handleDataAvailable(), onerror: null, onstart: null, onstop: handleStop(), onwarning: null } main.js:114:3

 State should be "inactive" main.js:70:1  <-- error
 handleDataAvailable() main.js:70
samdutton commented 8 years ago

Hi — thanks for that.

The assert statements were actually left over from the initial development stage. I've removed them now.