HTML5 Local video

0

I have this HTML code to try to play a video that is on my hard drive. When I open the source link directly in the browser, it reproduces without problem, however, using this code:

<video width="750" controls>
  <source src="C:\FileUploads\VideoMails_559400305_teste.mp4" type="video/mp4">
  Your browser does not support HTML5 video.
</video>

The player does not load anything. Any suggestions?

    
asked by anonymous 20.02.2017 / 14:48

2 answers

3

If protocol security, when you open the file directly from the directory, you are using the protocol file (file: // c: / .....) that is the same as the source of your video tag, but when you open it through the server, you will be using an http (or https) protocol in which the page is trying to access the client's local information, which although physically the same, per access type is different. Copy the file to the same location as your page and use relative address:

<video width="750" controls>
  <source src="./1_559400305_teste.mp4" type="video/mp4">
  Your browser does not support HTML5 video.
</video>

Or create a virtual directory for your videos, and go there.

    
20.02.2017 / 15:04
-1

Try to put the html in the same directory as the mp4 file and call only 1_559400305_teste.mp4 "

    
20.02.2017 / 14:56