2

I would like my webpage to look for some video files locally first, and then play them from the web if they are not found. This makes sense for me because I am building a kiosk that will run on someone else's wifi (that may be slow). I would like to do something like this:

<video id="video1" width="420">
    <source src="c:\website\assets\video\mov_bbb.mp4" type="video/mp4">
    <source src="\assets\video\mov_bbb.mp4" type="video/mp4">
    Your browser does not support HTML5 video.
</video>

This doesn't work for me because the video tag doesn't like that local pathing. I have seen people online suggesting the following, but I don't really understand how to implement it to solve my problem. Can anyone help?

<input type="file" accept="video/*"/>
<video controls autoplay></video>
Travis Needham
  • 385
  • 1
  • 4
  • 12
  • Try adding **file:///** before **C:\...**. – scootergrisen Apr 02 '14 at 14:42
  • 1
    Thanks guys. I actually solved this by simply installing a local webserver and pointing the first source to localhost, and the second to my website. Cheers! – Travis Needham Apr 03 '14 at 15:22
  • Using a webserver is proberly best but on my computer it works with **file:///**. Does **file:///c:\website\assets\video\mov_bbb.mp4** work if you visit the address directly in the browser ? – scootergrisen Apr 03 '14 at 22:23

2 Answers2

2

I actually solved this by simply installing a local webserver and pointing the first source to localhost, and the second to my website. Cheers!

Travis Needham
  • 385
  • 1
  • 4
  • 12
0

The <input> solution is discussed here: Play local (hard-drive) video file with HTML5 video tag?, but the user must choose the local file to be played. For security reasons I don't think a page can access file:// resources without user intervention.

Community
  • 1
  • 1
mabi
  • 522
  • 1
  • 6
  • 20