samdutton / simpl

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

what should i do to play in every 2 sec here ? #55

Closed feru007 closed 7 years ago

feru007 commented 9 years ago

thanks for this nice sample. it is so helpful. but i am facing a problem. in simpl / mediarecorder / js / main.js u used

count++; if (count > 1) { return; } console.log(e); videoElement.src = window.URL.createObjectURL(e.data);

as u used "if (count > 1) return;" so it executes once. i am trying to play in every 2 sec. i removed this condition checking. but in that case code also played first time only. what should i do to play in every 2 sec here ? Is there any issue ?

samdutton commented 9 years ago

Hi!

Glad to hear this was helpful.

The count variable is simply to ascertain whether the ondataavailable handler has already been called.

You can change the amount of data to be returned in the mediaRecorder.start() call – that's currently set to 2000 milliseconds.

There seems to be a problem with the download data, not sure why – I'm a bit busy on other projects at the moment, but you might want to file a Firefox bug.

Sam

On Wed, Nov 19, 2014 at 12:09 PM, feru007 notifications@github.com wrote:

thanks for this nice sample. it is so helpful. but i am facing a problem. in simpl / mediarecorder / js / main.js u used

count++; if (count > 1) { return; } console.log(e); videoElement.src = window.URL.createObjectURL(e.data);

as u used "if (count > 1) return;" so it executes once. i am trying to play in every 2 sec. i removed this condition checking. but in that case code also played first time only. what should i do to play in every 2 sec here ? Is there any issue ?

— Reply to this email directly or view it on GitHub https://github.com/samdutton/simpl/issues/55.

feru007 commented 9 years ago

Thanks  Sam for your quick reply. You are so helpful. This is my last question to you related to that code. I hope I am not disturbing you. Here i posted my question. I am eagerly waiting for your reply. http://stackoverflow.com/questions/27088389/audio-capture-and-playback-not-working-using-mediarecorder-api-and-html5-audio-t

You have enough idea about dictaphone example code . there was your comment too. The link is belowhttps://hacks.mozilla.org/2014/06/easy-audio-capture-with-the-mediarecorder-api/ I tried to reach the writer of this post but i didn't find his mail id. That's why i am knocking your help.After reading my posted question in stackoverflow can you tell me that did i miss anything ? orIs there any other way to set audio.src ? or is there any issue i am missing ? or suggest me anything... Waiting for your reply.Thanks in advance.-feru 

 On Thursday, November 20, 2014 8:13 PM, Sam Dutton <notifications@github.com> wrote:

Hi!

Glad to hear this was helpful.

The count variable is simply to ascertain whether the ondataavailable handler has already been called.

You can change the amount of data to be returned in the mediaRecorder.start() call – that's currently set to 2000 milliseconds.

There seems to be a problem with the download data, not sure why – I'm a bit busy on other projects at the moment, but you might want to file a Firefox bug.

Sam

On Wed, Nov 19, 2014 at 12:09 PM, feru007 notifications@github.com wrote:

thanks for this nice sample. it is so helpful. but i am facing a problem. in simpl / mediarecorder / js / main.js u used

count++; if (count > 1) { return; } console.log(e); videoElement.src = window.URL.createObjectURL(e.data);

as u used "if (count > 1) return;" so it executes once. i am trying to play in every 2 sec. i removed this condition checking. but in that case code also played first time only. what should i do to play in every 2 sec here ? Is there any issue ?

— Reply to this email directly or view it on GitHub https://github.com/samdutton/simpl/issues/55. — Reply to this email directly or view it on GitHub.