0

I am working on implementing getUserMedia for audio/video and then having it saved via local storage through HTML5 api. I have two issues.

The first issue is that when the audio connects it echos my voice very faintly and has a constant static sound (tested in firefox). Is there any known issues with this, I was unable to find an answer of any sort.

As well, is there documentation stopping and putting the mediaStream file into something to be saved via local storage or through ajax/php or anything like that? I am a little lost on how to stop and then keep the file.

MY JavaScript code and HTML code is below... THANK YOU!

<section>
        <!-- <audio controls autoplay></audio> -->
        <video controls autoplay></video>
        <input id="startRecording" type="button" value="Start Recording"/>
        <input id="stopRecording" type="button" value="Stop Recording"/>
</section>




window.onload = function() {

function hasGetUserMedia() {
    //Note: opera is unprefixed
    return !!(navigator.hasGetUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);
} //Check for Get User Media in browsers

function startRecording() {

        navigator.getUserMedia({audio: true, video: true},function(stream) {audio.src = window.URL.createObjectURL(stream); },onFail);
}

function stopRecording() {
    var audio  = document.querySelector('video');
    audio.src = "";Q
}

var onFail = function(e) {
    console.log("ERROR");
}
var audio  = document.querySelector('video');

if (hasGetUserMedia()) {
    //AWESOME!  Do whatever needs to be done
    window.URL = (window.URL || window.webkitURL || window.webkitURL || window.mozURL || window.msURL);
    navigator.getUserMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia );

    var startRecord =  document.getElementById('startRecording');
    var endRecord =  document.getElementById('stopRecording');
    startRecord.onclick = startRecording;
    endRecord.onclick = stopRecording;

} else {
    alert("FAIL");
    //Put in fallback for flash/silverlight?
} //Check for getUserMedia()

} //load this stuff onload
kmalik
  • 109
  • 1
  • 2
  • 11

1 Answers1

0

It is currently possible to capture video indirectly through the canvas, but the Mediastream Recorder API isn't implemented yet. So sound is going to be hard anyway.

As for the echo's, that is very well possible. See: https://hacks.mozilla.org/2013/06/webrtc-comes-to-firefox/

So I'm afraid you will have to wait a bit longer still.

Fab
  • 375
  • 1
  • 3
  • 11