doushi2047 2016-10-31 12:54
浏览 47

本地服务器上的HTML5视频播放器

I have a folder containing multiple video files (all with an mp4 extension) that I want to play sequentially and then loop once it plays through all of the videos in the folder. The files do not need to be exposed to the internet so I'm not worried about security, but rather my videos are played through a localhost apache2 server. I don't want to have to do something like this:

<html>
    <video autoplay>
    <source src="video1.mp4" type="video/mp4">
    <source src="video2.mp4" type="video/mp4">
    ...
    <source src="videoN.mp4" type="video/mp4">
    </video>
</html>

Because, I don't want to have to modify my index.php script every time I change the contents of my videos folder/directory, I am not looking for this. What I am looking for is something that is dynamic where the code is something more along the lines of:

1) Add all video files to a list
2) Iterate over each file in my list and then put as the video played by the video player.
3) Create a loop

The problem that I have found so far with looping and utilising PHP to echo HTML <video> tags is that it ends up showing all of the videos, one underneath the other and plays them all at the same time (as a result of the autoplay in the <video> tag). However, what I am wanting is for one video to play in the browser, then the next and so on...can anyone recommend the best way to do this please?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
    • ¥20 软件测试决策法疑问求解答
    • ¥15 win11 23H2删除推荐的项目,支持注册表等
    • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
    • ¥15 qt6.6.3 基于百度云的语音识别 不会改
    • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
    • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
    • ¥15 lingo18勾选global solver求解使用的算法
    • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
    • ¥20 测距传感器数据手册i2c