how to play videos on apache server
hi all,
i have made a LAMP server on a centos machine, i know you put any files you want to publish here - /var/www/html/ but what about if you copy a video file to that location, how do you play it back on the browser? many thanks, rob |
You need to create a web page that "points" to the video. That can be done several ways and the video needs to be in a format that supports the method.
http://www.computerhope.com/issues/ch000591.htm http://www.w3schools.com/TAgs/att_video_src.asp |
On my local network I just point my Apache server to the files then they play, in VLC, when opened with my browser.
You may need to describe the situation more clearly? |
i have it working by typing out the full path ie -
http://host-ip/directory-where-video-is/video-file.mp4 this plays as an embedded video on firefox and chrome but IE it asks me whether i want to open it or save it and when i choose open it opens up my default video player VLC how can i play it embedded in IE |
About your title: You cannot actually play videos in apache server: Web servers just send files and data to your browser. It is the browser that can actually play or render things or call 'helper' programs to do that.
A video is just a file. Make an HTML or XHTML properly formatted page that the browser can use to download your video and it will attempt then to render it. If it can, you are golden; if it cannot you may need to configure something (vlc?) to 'help' it with that final step or choose a different browser. |
Perhaps you're referring to the ability of HTML5 to embed video? In which case you need suitably encoded files and an HTML5 page for each file with (I'm going from memory here) something like a video canvas or video object embedded.
|
Quote:
Frankly I had not thought of using the media extensions in HTML5, and that might be a good thing to try! |
Quote:
The behavior described by the OP seems to be IE specific so it's either a client problem for all clients using IE and the IE clients need a group policy applying or, if they're not under control of the page writer, they need nudging by something like HTML5 tags. |
As others have pointed out, Apache doesn't "play" video; it serves a file. If a browser isn't "smart" enough to play the file, then the user ought to use an application that is meant to play that file type (such as vlc, which can play local or remote video quite happily).
If you want to use HTML5 magic, then something like this ought to do: Code:
<video class="motionpicture" width="720" height="480" autobuffer |
All times are GMT -5. The time now is 02:58 AM. |