mardi 30 novembre 2021

function webcam not show

i try to modified script with function webcam not work, that show my webcam and i can take picture. i think the code it's obsolete i try to change but nothing show

 var self = this;

    var video = document.querySelector("#videoElement");

    navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;
    
    if (navigator.getUserMedia) {       
        navigator.getUserMedia({video: true}, handleVideo, videoError);
    }
    
    function handleVideo(stream) {
        video.src = window.URL.createObjectURL(stream);
    }
    
    function videoError(e) {
        // do something
    }

could you help me




Aucun commentaire:

Enregistrer un commentaire