video chat conferencing using webRTC

i'm new in webRTC and i'm evaluating webRTC for video chat application, so i try to follow the tutorial in the book "Real Time communication with webRTC" (chapter 5) but i got this message in the console (i'm on win7) : Reference error : navigator is not defined.

any suggestions please

thank you

What browser are you using? This should work:

// you may just have to put your browser specific shims in parenthesis 
navigator.getUserMedia = (navigator.getUserMedia || navigator.webkitGetUserMedia ||
    navigator.mozGetUserMedia || navigator.msGetUserMedia);
if (navigator.getUserMedia) {
    navigator.getUserMedia(
        // constraints
        {
            video: true,
            audio: true
        },

        function(localMediaStream) {
            var video = document.querySelector('video');
            video.src = window.URL.createObjectURL(localMediaStream);

        },

        function(err) {
            console.log("The following error occured: " + err);
        });
} else {
    console.log("getUserMedia not supported");
}