1 2 3 4 navigator.getUserMedia = navigator.webkitGetUserMedia || navigator.getUserMedia;5 6 var constraints = {audio: true};7 8 var ok_callback = function(stream) {9 10 stream.onactive = function(e){ console.log('active'); };11 stream.onaddtrack = function(e){ console.log('addtrack'); };12 stream.onended = function(e){ console.log('ended'); };13 stream.oninactive = function(e){ console.log('inactive'); };14 stream.onremovetrack = function(e){ console.log('onremovetrack'); };15 16 console.log(stream);17 18 window.s = stream;19 20 /*21 recordingPlayer.srcObject = audioStream;22 recordingPlayer.play();23 24 config.onMediaCaptured(audioStream);25 26 audioStream.onended = function() {27 config.onMediaStopped();28 };29 */30 };31 32 var err_callback = function(error) {33 console.log(error);34 //config.onMediaCapturingFailed(error);35 };36 37 38 navigator.getUserMedia(constraints, ok_callback, err_callback);39 40
Enlace
El enlace para compartir es: