Reputation: 28
I have an Apache Server running on linux
The directory used for the website is the default /var/www
When Using Video.js, setting the video source is easy when the files are in the same directory.
e.g.
/var/www/index.html
/var/www/video/video1.mp4
<source src="video/video1.mp4" type='video/mp4' />
I can't seem to set this source if the files are not in the Apache folder however. e.g.
/home/user/video/video2.mp4
<source src="/home/user/video/video2.mp4" type='video/mp4' />
Upvotes: 0
Views: 235
Reputation: 3239
If Apache is using /var/www as your root, I don't think it will allow access to anything outside of that directory. Have you tried accessing those files directly in a browser, outside of video.js?
Additionally, by setting the source URL to '/home/user/video/video2.mp4', you're telling the browser to look for the file at "www.mywebsite.com/home/user/video/video2.mp4', which apache will translate to "/var/www/home/user/video/video2.mp4".
I'm far from an expert on how Apache works, but I hope that helps.
Upvotes: 1