Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Javascript screenshot

let canvas = document.createElement('canvas');
let video = document.getElementById('my-video');
let image = '';

video.addEventListener('seeked', function(){
    canvas.width = 1920;
    canvas.height = 1080;

    let ctx = canvas.getContext('2d');
    ctx.drawImage( video, 0, 0, canvas.width, canvas.height );

    image = canvas.toDataURL('image/jpeg');
});

video.currentTime = TIME_IN_SECONDS;
Source by serversideup.net #
 
PREVIOUS NEXT
Tagged: #Javascript #screenshot
ADD COMMENT
Topic
Name
5+9 =