本文介紹了實現簡易html視頻播放器的方法,分享給大家,具體如下:
文件列表
root@tianshl:/data/video# lshch.mp4 test.mp4 xyx.mp4 index.html video.list jquery.js
index.html
!DOCTYPE html html head meta charset= UTF-8 style type= text/css 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; /style /head body p id= content-wrap p id= content p >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視頻播放器的方法的詳細內容,html教程
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。
新聞熱點
疑難解答