Could not do WebRTC Remote stream recording in firefox

555 views
Skip to first unread message

Kavya S

unread,
Aug 11, 2015, 2:49:05 AM8/11/15
to discuss-webrtc
Remote stream recording in firefox fails saying , 'Security Error: This operation is insecure'.  How do i do remote stream recording in firefox? Is recording not fully implemented in Firefox stable version?

Christoffer Jansson

unread,
Aug 11, 2015, 3:01:32 AM8/11/15
to discuss-webrtc
Hi,

Without knowing exactly what you are doing but that error looks like a HTTPS issue, i.e. you might need to serve the page over HTTPS?

/Chris

Kavya S

unread,
Aug 25, 2015, 6:04:40 AM8/25/15
to discuss-webrtc
Hi Chris,

Thanks for your response.

I'm doing one-to-one video conferencing in WebRTC. For example, video conferencing between Alice and Bob. I'm doing recording of remote stream i.e Recording Alice stream from Bob's side. This works fine on Chrome except that it failed to record audio. But in firefox(version 40), recording did not happen, throwing error: 'Security Error: This operation is insecure' . I'm using MediaStreamRecorder.js(Muaz's sample) to do this recording. 

I enabled HTTPS with self signed certificate after your comments. But the issue remains the same.

I tried googling but could not find any clue regarding this issue.
Kindly provide me any suggestions of why remote stream recording fails in Firefox.

Andreas Pehrson

unread,
Aug 25, 2015, 6:09:24 AM8/25/15
to discuss...@googlegroups.com
Get a stack trace to that exception and it will be pretty easy to figure out what's happening.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/40fdac62-be92-4469-ab5f-424278299675%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

j...@web-computing.de

unread,
Sep 4, 2015, 7:17:36 AM9/4/15
to discuss-webrtc
Hi,

I have exactly the same issue. Is there now a solution?

AirMike

unread,
Oct 5, 2015, 7:39:01 PM10/5/15
to discuss-webrtc
I also have the same issue.
Same stuff worked before, but now I get this security error.

Please help...

AirMike

unread,
Oct 5, 2015, 7:50:43 PM10/5/15
to discuss-webrtc
Just to give some more info.
I initiate two MediaRecorders, one for each stream (local and remote) and then start to record them separately.
MediaRecorder attached to local stream start to record but MediaRecorder attached to remote stream throws "SecurityError: The operation is insecure." on start method of initiated MediaRecorder.
Both sites are on https (recording app is on Firefox) 

Christoffer Jansson

unread,
Oct 6, 2015, 3:15:13 AM10/6/15
to discuss...@googlegroups.com, mre...@mozilla.com
+mre...@mozilla.com

Maire, do you have any input here or do you know someone who can help?

Thanks!
/Chris


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

AirMike

unread,
Oct 6, 2015, 4:00:43 AM10/6/15
to discuss-webrtc, mre...@mozilla.com
I have new info that approximately one in five times recording is OK. 

Do You need any extra info (I have extensive console log if that can help)?
Please help...

Andreas Pehrson

unread,
Oct 6, 2015, 4:17:22 AM10/6/15
to discuss...@googlegroups.com, mre...@mozilla.com
If you have a stack trace for that exception, that would be super useful.

Or if you have a test case where I can just jump in and debug myself (a jsfiddle for instance), that would certainly speed things up.

AirMike

unread,
Oct 6, 2015, 7:18:02 AM10/6/15
to discuss-webrtc, mre...@mozilla.com
I think I found where the problem was, at least in my case.

In my case everything starts on onaddstream callback of webrtcPeerConnection when remote stream is added to peer connection.
Before record starts I have one extra check and that is wait for remote stream to flow which was based on checking if mediaElement in which remote stream is showing has currentTime > 0.
That was OK so far, but I guess sometimes its not enough so I extended check with readyState and paused

    if (media.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA && 
        media.currentTime > 0 &&
        ! media.paused
    ) {
        // OK to start recording
    }
    else {
        // defer and check again
    }

It looks like sometimes all this check pass but stream cannot yet be recorded (maybe flow didn't started yet depending on network speed)

Maire Reavy

unread,
Oct 6, 2015, 10:30:14 AM10/6/15
to discuss...@googlegroups.com, airm...@gmail.com, mre...@mozilla.com, discuss...@googlegroups.com
It sounds like the origin isn't being properly set on a remote stream until data starts to flow.  Can you file a bug in our bug tracker?  Just click on this link and fill in the template:  https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&component=Audio%2FVideo%3A%20Recording

Please include all the info you have when you file the bug, and we can drive it forward from there.

Cheers,
-Maire
mre...@mozilla.com, m...@reavy.org

AirMike

unread,
Oct 7, 2015, 4:11:23 AM10/7/15
to discuss-webrtc, airm...@gmail.com, mre...@mozilla.com
Reply all
Reply to author
Forward
0 new messages