Skip to content Skip to sidebar Skip to footer

WebRTC GetUserMedia Not Showing Video

I have the following code: document.addEventListener('DOMContentLoaded', function () { var video = document.querySelector('video'); window.navigator.webkitGetUserMedia({ vide

Solution 1:

You have to assign the url to video.src, not the stream:

navigator.webkitGetUserMedia({ video: true, audio: true }, function ( stream ) {
    video.src = window.webkitURL.createObjectURL( stream );
}, function ( err ) {
    console.log( 'error: ', err );
});​

Live demo: http://jsfiddle.net/FcTMk/2/ (Webkit only)


Post a Comment for "WebRTC GetUserMedia Not Showing Video"