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 to stop Microm after recording is finished? #24

Open
w95 opened this issue Apr 5, 2017 · 4 comments
Open

How to stop Microm after recording is finished? #24

w95 opened this issue Apr 5, 2017 · 4 comments

Comments

@w95
Copy link

w95 commented Apr 5, 2017

How to stop Microm or destroy after recording, because recording icon on tab is not hiding..

I use Chrome 57 on Ubuntu 16

recording
@zzarcon
Thanks

@buzinas
Copy link
Contributor

buzinas commented May 12, 2017

The only way to remove the icon is by stopping the stream. Currently, microm doesn't do that automatically when stopping (nor RecordRTC - and I don't know if that's intended or not).

Created #25 so we can have a low-level access to the stream and use it. For removing the red icon, we would end up with something like this:

let stream, mp3;

function start() {
  microm.record().then(s => {
    stream = s;
    console.log('recording...');
  });
}

function stop() {
  microm.stop().then(result => {
    mp3 = result;
    stream.getAudioTracks().forEach(track => track.stop()); // removes the red icon
  });
}

@philfreo
Copy link

Should stopRecording() just stop the stream automatically?

@buzinas
Copy link
Contributor

buzinas commented May 12, 2017

stopRecording is a RecordRTC method, and yes, I agree they probably should do it there

There was an issue for it, but the guy solved with a workaround:
muaz-khan/RecordRTC#119

If they don't, maybe microm should do it in the stop method, but as I said above, I'm not sure if the current behavior is intended or not. Let's see what they answer!

@zzarcon
Copy link
Owner

zzarcon commented May 13, 2017

@philfreo @buzinas that makes a lot of sense to me, we should stop the stream inside stopRecording 👯

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

4 participants