HTML5 canvas. How does the start-clear flag set to false?

I started working with Canvas and HTML5 video, and I have a problem: I tried demos and experiments, but I can’t watch them if I don’t upload them to my web server. This does not create a huge problem at the moment, because I work with relatively small files, but in fact I am preparing a larger project, and this problem will be very inconvenient very quickly. And also I just wanted to get my facts straight. I work both with my own videos and with demos. I worked with videos that I encoded many years ago, and I worked with videos that I encoded in a minute before using them in my code. This is always the same result: using the HTML5 Video container, using the video inside Canvas is not performed, Canvas just does not display the video (if, as I mentioned, I do not upload them to the server).

This is the information I have found so far:

http://html5doctor.com/video-canvas-magic/

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#security-with-canvas-elements

(and some info on w3, but I'm not allowed to post more than two links)

From what I understand, my canvas should be corrupted, and my files do not look β€œclean,” but that’s all I managed to figure out. I do not understand why.

Does anyone know about this and can explain how and why it works?

+3
source share
1 answer

There is a strict separation between browsers between any downloaded from http:// and any downloaded from URI file:// . This is actually quite reasonable, otherwise random pages downloaded from the Internet will be able to read files from your hard drive. There are a few additional restrictions that apply to file:// URIs , again they are designed to prevent downloading files from the Internet to launch your hard drive.

Having said all this, if your HTML file and video are all sitting in the same directory on your hard drive, everything should work, since all these conditions must be met.

If you still have problems, one of the useful approaches for local development is to use a lightweight web server. Personally, I use Python SimpleHTTPServer because it is already installed on my machine, but there are many others - often web development (like Ruby on Rails) comes with them.

+2
source

All Articles