这篇文章主要介绍了实现简易html视频播放器的方法,h5创建视频播放器很简单,您只需要添加一些h5的标签即可创建出炫酷的播放器
本文介绍了实现简易html视频播放器的方法,分享给大家,具体如下:
文件列表
root@tianshl:/data/video# lshch.mp4 test.mp4 xyx.mp4 index.html video.list jquery.js
index.html
立即学习“前端免费学习笔记(深入)”;
body{ text-align: center; } #content-wrap{ margin-top: 50px; display: inline-block; } #content{ display: flex; } /* 播放器 */ #video{ display: inline-block; margin: 0; border: 12px solid #eee; box-sizing: border-box; } .video-list-wrap{ background-color: #eee; border-right: 1px solid #fff; } /* 视频列表 */ .video-list{ display: inline-block; box-sizing: border-box; margin: 0; width: 150px; list-style: none; padding: 0; overflow: auto; font-size: 12px; } /* 列表项 */ .video-item{ cursor: pointer; width: 150px; box-sizing: border-box; text-align: left; padding: 5px 0 5px 10px; } .video-item:not(:last-child){ border-bottom: 1px solid #fff; } .video-item:hover, .active{ background-color: #ddd; color: #333; } /* 视频列表标题 */ .video-title{ background-color: gainsboro; font-size: 12px; height: 30px; line-height: 30px; text-align: center; }
视频列表
video.list
# 该目录下的所有MP4文件, 供jQuery解析root@tianshl:/data/video# ls *.mp4 > video.list
nginx配置
user root;worker_processes 1;events { worker_connections 1024;}http { include mime.types; sendfile on; keepalive_timeout 65; server { listen 8000; server_name 本机IP; location / { # 前两行是认证(可不加) auth_basic "secret"; auth_basic_user_file /usr/local/nginx/passwd.db; # 路径 root /data/video; # 首页 index index.html; } }}界面展示
http://localhost:8000
认证

播放器

相关推荐:
HTML5 video 视频标签使用介绍
以上就是实现简易html视频播放器的方法的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1546162.html
微信扫一扫
支付宝扫一扫