本文介绍了实现简易html视频播放器的方法,分享给大家,具体如下:
文件列表
root@tianshl:/data/video# ls hch.mp4 test.mp4 xyx.mp4 index.html video.list jquery.js
index.html
视频列表
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
认证
播放器
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。