javascript - HTML5 canvas (videothumbnail) gives SecurityError -
i have read lost of threads on wasnt able find solution. situation. i've loaded video , created thumbnail html5 canvas. when try save canvas image =todataurl
error:
uncaught securityerror: failed execute 'todataurl' on 'htmlcanvaselement': tainted canvases may not exported.
<video id="video" width="200" src="https://sportsquare.s3.amazonaws.com/2012030311_big_1.mp4" type="video/mp4" controls></video><br/> <canvas id="canvas"></canvas><br/> <script> window.setinterval(function(){ var canvas = document.getelementbyid('canvas'); var video = document.getelementbyid('video'); canvas.getcontext('2d').drawimage(video, 0,0,175,125); var dataurl = canvas.todataurl("image/png"); dataurl = dataurl.replace(/^data:image\/(png|jpg);base64,/, ""); }, 2000); </script>
Comments
Post a Comment