Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
youtube screen
  • just create a book mark with this url
  • play the video and stop it
  • click in the bookmark
javascript:"use strict";!function(window,document){var canvas=document.createElement("canvas"),video=document.querySelector("video"),ctx=canvas.getContext("2d");canvas.width=parseInt(video.offsetWidth),canvas.height=parseInt(video.offsetHeight),ctx.drawImage(video,0,0,canvas.width,canvas.height);var base64ImageData=canvas.toDataURL("image/jpeg"),filename="snap-"+canvas.width+"x"+canvas.height+"-"+video.currentTime+".jpg",a=document.createElement("a");a.download=filename,a.href=base64ImageData;var img=document.createElement("img");img.src=base64ImageData,img.alt=filename,img.title="Click to save "+filename,window.open().document.body.appendChild(a).appendChild(img)}(window,document);

https://github.com/ReeganExE/youtube-screenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment