Reputation: 29
Okay, I have video files on my network drive which I would like to play on my website, only pc's connected to my network and visit my site will see the files.
So I am trying to use videojs.com to get this working...
If I enter a video file that is hosted online it will play it, entering
file://mybooklive/Public/Shared%20Movies/Anchorman%20(2004).mp4
it will not play (even though typing that into chrome's URL bar will play the video).
So basically this WILL play a online video...
<video id="my_video_1" class="video-js vjs-default-skin" controls
preload="auto" width="640" height="264" poster="my_video_poster.png"
data-setup="{}">
<source src="http://vjs.zencdn.net/v/oceans.mp4"
type='video/mp4'> </video>
and this will not play (local file)
<video id="my_video_1" class="video-js vjs-default-skin" controls
preload="auto" width="640" height="264" poster="my_video_poster.png"
data-setup="{}">
<source src="file://mybooklive/Public/Shared%20Movies/Anchorman%20(2004).mp4"
type='video/mp4'> </video>
Please help!!!
I'm using MyBookLive so I don't think I can enter an IP address.
Upvotes: 2
Views: 22712
Reputation: 1534
You are trying to play using your file path, you will need to use the Internet URL absolute path Please change your code, so that the file will be available through URL, and not file system
Using this model, you can place your files anywhere, as long as you point the correct URL to them
Read more about video.js documentation and starting up here
<video id="my_video_1" class="video-js vjs-default-skin" controls
preload="auto" width="640" height="264" poster="my_video_poster.png"
data-setup="{}">
<source src="http://path-to-your-website/Shared%20Movies/Anchorman%20(2004).mp4"
type='video/mp4'> </video>
Read more about it here
If you don't want to use an absolute path, you can use a relative path, based on where your script is :
<video id="my_video_1" class="video-js vjs-default-skin" controls
preload="auto" width="640" height="264" poster="my_video_poster.png"
data-setup="{}">
<source src="relative-path-to-your-mp4/Anchorman%20(2004).mp4"
type='video/mp4'> </video>
Upvotes: 0
Reputation: 2869
No need for file://
Put your video in the same folder as your html fime and use,
<video width="640" height="264" controls>
<source src="filename.mp4" type="video/mp4">
</video>
Upvotes: 0