Code:
if (navigator.getUserMedia) {
navigator.getUserMedia(
// constraints
{
//video: true,
audio: true
},
// successCallback
function (localMediaStream) {
var audio = document.querySelector("audio");
console.log(localMediaStream,"");
audio.src = window.URL.createObjectURL(localMediaStream);
console.log(audio.src,"")
// do whatever you want with the video
audio.play();
},
// errorCallback
function (err) {
console.log("The following error occured: " + err);
});
} else {
alert("getUserMedia not supported by your web browser or Operating system version");
}
localMediaStreampcbloburlaudio
:localMediaStreammp3