Skip to content
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

Firefox & Chrome crashes #67

Closed
web-maker opened this issue Apr 11, 2016 · 13 comments
Closed

Firefox & Chrome crashes #67

web-maker opened this issue Apr 11, 2016 · 13 comments

Comments

@web-maker
Copy link

FF (or Crome) crashed when user set permissions to use microphone and select No video for video input device. In FF was detected next message:
MediaRecorder Error error { target: MediaRecorder, isTrusted: true, name: "OutOfMemoryError", currentTarget: MediaRecorder, eventPhase: 2, bubbles: false, cancelable: false, defaultPrevented: false, timeStamp: 1460385666006891, originalTarget: MediaRecorder, explicitOriginalTarget: MediaRecorder }
Problem is actually in Chrome 48/49 and FF 44/45 versions on Windows 10 and Ubuntu 14.04. Is any quickfix for this problem?

@thijstriemstra
Copy link
Member

What code are you using?

@web-maker
Copy link
Author

@thijstriemstra ,
Player configs:

var player = videojs("recorded-video", {
    controls: true,
    loop: false,
    plugins: {
        record: {
            maxLength: 90,
            debug: true,
            image: false,
            audio: true,
            video: {
                width: { min: 640, ideal: 800, max: 1280 },
                height: { min: 480, ideal: 600, max: 720 }
            }
        }
    }
});

I use custom button for starting record:

$('#record-modal .start-record').click(function(){
    player.recorder.getDevice();
    player.recorder.start();
});

This demo crashed too https://collab-project.github.io/videojs-record/examples/audio-video.html

@thijstriemstra
Copy link
Member

You shouldn't start the recorder right after you call getDevice, make sure the device is active first and call recorder.start() from the deviceReady event handler. With that being said, I'm also seeing an error in Firefox 45.0.2 on OSX 10.11.4 that I've never encountered before:

 MediaStreamError {
name: "NotFoundError",
message: "The object can not be found here.",
constraint: "",
stack: ""
}

@thijstriemstra
Copy link
Member

Now that I restarted the browser I can't reproduce it though, weird.

It could be a imcompatible constraint thing as well, can you try including http://webrtc.github.io/adapter/adapter-latest.js before your scripts and see if that helps?

@thijstriemstra
Copy link
Member

Ok, when I select 'No video' for that option my Firefox browser crashes as well. May I ask why you select no video when you're trying to record both audio and video? To reproduce a user error? And how are you selecting 'no' for video on Chrome. I do not have a option to set it to no in OSX, can you make a screenshot?

@thijstriemstra
Copy link
Member

When I do the same in this example the browser doesn't crash.

@thijstriemstra
Copy link
Member

I've tried debugging the issue and it looks like it's a recordrtc problem, maybe muaz-khan/RecordRTC#117. When I downgrade recordrtc to 5.3.0 (bower install recordrtc#5.3.0) a stacktrace appears and an error about too much recursion:

MediaStreamRecorder/this.record/mediaRecorder.onerror()
 RecordRTC.js:1542
MediaStreamRecorder/this.pause()
 RecordRTC.js:1685
MediaStreamRecorder/this.clearRecordedData()
 RecordRTC.js:1728
startRecording()
 RecordRTC.js:51
MRecordRTC/this.startRecording/</<()
 RecordRTC.js:917
initRecorder/config.initCallback()
 RecordRTC.js:72
MediaStreamRecorder/this.record()
 RecordRTC.js:1585
MediaStreamRecorder/this.resume()
 RecordRTC.js:1702
startRecording()
 RecordRTC.js:52
MRecordRTC/this.startRecording/</<()
 RecordRTC.js:917
initRecorder/config.initCallback()
 RecordRTC.js:72
MediaStreamRecorder/this.record()
 RecordRTC.js:1585
MediaStreamRecorder/this.resume()
 RecordRTC.js:1702
startRecording()
 RecordRTC.js:52
MRecordRTC/this.startRecording/</<()
 RecordRTC.js:917
initRecorder/config.initCallback()
 RecordRTC.js:72
MediaStreamRecorder/this.record()
 RecordRTC.js:1585
MediaStreamRecorder/this.resume()
 RecordRTC.js:1702
startRecording()
 RecordRTC.js:52
MRecordRTC/this.startRecording/</<()
 RecordRTC.js:917
initRecorder/config.initCallback()
 RecordRTC.js:72
MediaStreamRecorder/this.record()
 RecordRTC.js:1585
MediaStreamRecorder/this.resume()
etc...

@thijstriemstra
Copy link
Member

Also seeing the OutofMemory error after some fiddling with RecordRTC:

error { target: MediaRecorder,
isTrusted: true,
name: "OutOfMemoryError",
currentTarget: MediaRecorder,
eventPhase: 2,
bubbles: false,
cancelable: false,
defaultPrevented: false,
timeStamp: 1460480534534266,
originalTarget: MediaRecorder,
explicitOriginalTarget: MediaRecorder }

@web-maker
Copy link
Author

@thijstriemstra First of all thank you for replies and help. You say:

May I ask why you select no video when you're trying to record both audio and video?

I'm just acted as a user. They can do it, so I have to handle this behavior.

And how are you selecting 'no' for video on Chrome. I do not have a option to set it to no in OSX, can you make a screenshot?

Sure, just go to chrome://settings/content#media-stream-mic and there we can disable camera or microphone screen.
You also can get this settings by click this link.

When I do the same in this example the browser doesn't crash. The recordrtc audio+video example also seems to work fine in Firefox.

It's strange, but first link doesn't work in my FF 44.0.2. Error:

Unable to create MediaRecorder with options Object:  TypeError: Argument 1 is not valid for any of the 2-argument overloads of MediaRecorder.
Stack trace:
startRecording@https://simpl.info/mediarecorder/js/main.js:112:21
toggleRecording@https://simpl.info/mediarecorder/js/main.js:98:5

@thijstriemstra
Copy link
Member

I've opened a new recordrtc issue because I can also reproduce it without videojs-record so it's a recordrtc.js issue, see muaz-khan/RecordRTC#118. I agree that it's a user error that should be handled. I've tried debugging the error but couldn't fix it, let's continue the conversation on the recordrtc.js ticket because there's not much I can do in this plugin I think.

@web-maker web-maker changed the title Firefox & Opera crashes Firefox & Chrome crashes Apr 12, 2016
@thijstriemstra
Copy link
Member

@web-maker well looks like @muaz-khan pushed a fix for this issue, can you give the latest recordrtc a try?

@web-maker
Copy link
Author

@thijstriemstra I have already tested the latest version. Looks like it works fine - no crashes now in Chrome and FF. Many thanks to you andI have already tested the latest version. Looks like it works fine - no crashes now in Chrome and FF. Many thanks to you and mauz-khan.

@thijstriemstra
Copy link
Member

Awesome! Thanks guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants