How to play videos on Apache server

这一生的挚爱 提交于 2019-12-25 02:07:05

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/48648070/how-to-play-videos-on-apache-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!