HTML5 Local video

Asked

Viewed 122 times

0

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

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

The player does not load anything. Any suggestions?

2 answers

3


Question if protocol security, when you open the file directly from the directory, you are using the file protocol (file://c:/....) which is the same as the source of your video tag, but when you open through the server, you will be using an http protocol (or https) where the page will be trying to access local customer information, which despite being physically the same, by type of access are different. Copy the file to the same location as your page and use the 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.

-1

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.