cbrandolino / camvas

HTML5 webcam to canvas stream
http://cbrandolino.github.com/camvas
503 stars 43 forks source link

Fix syntax error. #10

Closed shimabox closed 6 years ago

shimabox commented 6 years ago

I tried to get the elapsed time, but it was NaN.

<script>
window.onload = function(){
  var ctx = document.getElementsByTagName('canvas')[0].getContext('2d')
  var draw = function(video, dt) {
    console.log(dt); // => NaN
    ctx.drawImage(video, 0, 0)
  }
  var myCamvas = new camvas(ctx, draw)
}
</script>

I fixed it for that.

shimabox commented 6 years ago

@cbrandolino Thank you for approval. I would be happy if you merge it when you are free.

shimabox commented 6 years ago

@cbrandolino Thank you for a nice library!