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

How do you request timeSlice? #232

Closed
notsoluckycharm opened this issue Mar 28, 2017 · 1 comment
Closed

How do you request timeSlice? #232

notsoluckycharm opened this issue Mar 28, 2017 · 1 comment

Comments

@notsoluckycharm
Copy link

Read through the code, what was the thinking behind removing both RequestData and the timeSlice input parameter? You've got heavy referencing of it in the code and hard coding the time parameter is less than ideal.

Just want to know your thoughts before I try to write it in. Thanks!

@muaz-khan
Copy link
Owner

This one?

// void start(optional long mTimeSlice)
// The interval of passing encoded data from EncodedBufferCache to onDataAvailable
// handler. "mTimeSlice < 0" means Session object does not push encoded data to
// onDataAvailable, instead, it passive wait the client side pull encoded data
// by calling requestData API.
mediaRecorder.start(3.6e+6); // default is 60 minutes; enough?

Yep, these hints are redundant; and should be removed. These hints explains how start method operates internally (on C++ level---by the browser implementation).

Regarding requesting the data, we are using stop method instead.

if (mediaRecorder.state === 'recording') {
    // "stop" method auto invokes "requestData"!
    // mediaRecorder.requestData();
    mediaRecorder.stop();
}

Now we get ondataavailable event fired, and the resulting blob is passed back to the stopRecording callback.

AndersDJohnson pushed a commit to AndersDJohnson/RecordRTC that referenced this issue Apr 8, 2019
…" for dev/MediaStreamRecorder

dev/MultiStreamRecorder now uses "MediaStream.addTrack" instead of
"CanvasCaptureMediaStream.addTrack".
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