I am using recording.js. The functionality is working fine but after I stop recording the red icon still appears in chrome's tab(near title). Please suggest what to do. Sorry if it is damn easy.. :P
This is my code:
window.URL = window.URL || window.webkitURL;
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
var recorder;
var savedSrc = '';
var audio = document.querySelector('audio');
var onFail = function(e)
{
console.log('Rejected!', e);
};
var onSuccess = function(s)
{
var context = new AudioContext();
var mediaStreamSource = context.createMediaStreamSource(s);
recorder = new Recorder(mediaStreamSource);
recorder.record();
$('#recordText').html('Recording...');
// audio loopback
// mediaStreamSource.connect(context.destination);
};
function startRecording()
{
if (navigator.getUserMedia)
{
navigator.getUserMedia(
{
video : false,
audio : true,
toString : function()
{
return "audio";
}
}, onSuccess, onFail);
}
else
{
console.log('navigator.getUserMedia not present');
}
};
function stopRecording()
{
$('#recordText').html('Record');
recorder.stop();
recorder.exportWAV(function(s)
{
audio.src = window.URL.createObjectURL(s);
});
}
This is because this recording icon is the one of getUserMedia streaming, not the one of MediaRecorder . When you stop the MediaRecorder, the stream is still active. To stop this gUM stream (or any other MediaStream), you'd call MediaStreamTrack. stop() .
In your soundAllowed(stream) function, you can stop the recording by executing stream. getTracks()[0]. stop() assuming that you only have that media track active.
The MediaRecorder API enables you to record audio and video from a web app. It's available now in Firefox and in Chrome for Android and desktop.
On the main page, choose "Status Bar," then "Auto Detect." After a second or two, the app will display a new page with every status bar icon available on your Android 11 device, including the hidden screen recording icon. Disable the toggle next to the "screen_record" option and you're all set!
When you restart your system, these issues will be cleared and, hopefully, the red mark will be gone. The troubleshooter is a built-in tool designed to find and resolve problems affecting your audio output. It primarily checks for conflicts that are preventing the audio service from running properly and promptly gets rid of them.
On the Hardware and Sound page, click on Manage Audio Devices under Sound. Once the Sound dialog window appears, select your system’s main speakers as the default device and click on the OK button. The presence of the red X mark might be an indication that the Windows audio services aren’t functioning properly.
From there, start a recording, then expand your notification shade and long-press the recording notification. Select the gear icon that appears, then choose "Screen Recorder" and set it to "Silent" on the next screen. Now, you'll still have the notification for stopping recording, but you won't see any icons in your status bar!
To remove red icon after using Recorder.js:
var audioStream;
var onSuccess = function(s) {
...
audioStream = s;
}
function stopRecording() {
...
audioStream.getTracks()[0].stop();
}
getTracks() returns only one element since you use only audio in your config.
I hope it will help someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With