canvas.toDataURL() Security Error The operation is insecure

前端 未结 7 2174
时光取名叫无心
时光取名叫无心 2020-12-03 02:37

When I am trying to get a screenshot and save it as PNG before uploading video to server, I am having the following problem

7条回答
  •  北海茫月
    2020-12-03 03:25

    It's because of the Same Origin Policy. Basically, you're not allowed to access the video data of something loaded from another origin/site using a canvas.

    Drawing video data on the canvas sets the origin-clean flag to false, which stops you from getting the image data in any way.

    See toDataURL for more information.

提交回复
热议问题