webrtc - voice does not work

I want use webRTC to show video from my camera and hear sound from my microphone but voice does not work. Do you have any idea why my code does not work properly?JS \[code\]if(navigator.getUserMedia){ navigator.getUserMedia({ video: true, audio: true }, onSuccess, onError);}else{ console.log('Twoja przegladarka nie obsluguje webRTC - getUserMedia');}function onSuccess(stream){ var video = document.getElementById('webcam'), videoSrc; //audioContext, //mediaStreamSource; if (window.webkitURL) { videoSource = window.webkitURL.createObjectURL(stream); } else { videoSource = stream; } video.autoplay = true; video.src = http://stackoverflow.com/questions/15541620/videoSource;var audioContext ='AudioContext' in window ? new AudioContext() : (('webkitAudioContext' in window) ? new webkitAudioContext() : null); if (audioContext) { var mediaStreamSource = audioContext.createMediaStreamSource(stream); mediaStreamSource.connect(audioContext.destination); } else { // ... } }\[/code\]
 
Back
Top