Sreenivas K
Sreenivas K

Reputation: 119

How to play videos on Apache server

I have installed Apache server on a Ubuntu machine, created directory in Apache

/var/www/html/myvideos/

and copied the videos to this location, how do you play it back on the browser?

I have opened the URL in browser

http://my_server_ip/myvideos/testvideo.mp4

The video doesn't get played in the browser. Do I need to make any configuration in Apache server to make the video play in the browser ?

Please guys, help me on this. Thanks

Upvotes: 1

Views: 7936

Answers (1)

Finnegan
Finnegan

Reputation: 43

You should embed a link to the video in your index.html by doing this.

<video width="320" height="240" controls>
<source src="/var/www/html/myvideos/[videoname].mp4" type="video/mp4">
</video>

Then, you can click the player in your index.html, and watch your video there.

Upvotes: 2

Related Questions