如何在Apache服务器上播放视频 [英] How to play videos on Apache server

查看:1051
本文介绍了如何在Apache服务器上播放视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Ubuntu机器上安装了Apache服务器,并在Apache中创建了目录

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

/var/www/html/myvideos/

/var/www/html/myvideos/

并将视频复制到此位置,如何在浏览器中播放?

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

我已经在浏览器中打开了URL

I have opened the URL in browser

http://my_server_ip/myvideos/testvideo.mp4

视频无法在浏览器中播放. 我需要在Apache服务器中进行任何配置才能在浏览器中播放视频吗?

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 ?

请大家帮我. 谢谢

推荐答案

您应该这样做,将指向视频的链接嵌入到index.html中.

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>

然后,您可以单击index.html中的播放器,并在那里观看视频.

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

这篇关于如何在Apache服务器上播放视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆