Slide 50
Slide 50 text
step = 1 # extract a frame every on second
extractFrame = (video, width, height, time = 0) ->
video.currentTime = time
$(video).one 'seeked', ->
ctx = createAndInsertCanvas(width, height)
ctx.drawImage(video, 0, 0, width, height)
time += step
if time < video.duration
extractFrame(video, width, height, time)
else
$('#output')
.show()
.on('mousemove', scrub)
.find('canvas:not(:last)')
.hide()