<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>DPlayer with Video List</title>
<link rel="stylesheet" href="css/dp.css">
<style>
#video-list {
width: 160px;
height: 100%;
position: fixed;
z-index: 99;
top: 0;
/* left: 0px; */
left: -120px;
}
.list_l {
width: 120px;
float: left;
height: 100%;
background: rgba(255, 255, 255, 0.8);
}
.list_l ul {
margin: 0;
padding: 20px 0px 20px 0px;
list-style: none;
}
.list_l ul li {
background-color: rgba(255, 255, 255, 0.4);
padding: 8px;
font-size: 14px;
border-bottom: 1px #fff solid;
cursor: pointer;
}
.list_r {
width: 40px;
float: right;
height: 100%;
background-image: url(images/l.png);
background-repeat: no-repeat;
background-position: center;
background-size: 100% auto;
background-color: rgba(255, 255, 255, 0.2);
cursor: pointer;
}
.list_l ul li.on {
color: #f00
}
.rotate-180 {
transform: rotate(180deg);
}
</style>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/DPlayer.min.js?id=21"></script>
</head>
<body>
<div id="video-list">
<div class="list_l">
<ul id="molist">
<li data-video="file/6/1.mp4" class="on">安亭小学</li>
<li data-video="file/6/2.mp4">曹王小学</li>
<li data-video="file/6/3.mp4">方泰小学</li>
<!-- 更多视频项... -->
</ul>
</div>
<div class="list_r"></div>
</div>
<div id="dplayer" class="dplayer"></div>
<script>
const dp = new DPlayer({
container: document.getElementById('dplayer'),
autoplay: true,
video: {
// 初始视频
url: 'file/6/1.mp4'
},
});
const videoList = document.getElementById('video-list').getElementsByTagName('li');
var curri = getParam("i") ? getParam("i") : 0;
if (curri >= videoList.length) {
curri = 0;
}
dp.on('ended', function() {
console.log("当前:" + curri);
curri = parseInt(curri) + 1;
if (curri >= videoList.length) {
curri = 0;
}
$("#molist li").eq(curri).click();
setTimeout(function() {
dp.play();
}, 500)
});
for (let i = 0; i < videoList.length; i++) {
videoList[i].addEventListener('click', function() {
const videoUrl = this.getAttribute('data-video');
console.warn(videoUrl);
dp.video.url = videoUrl;
dp.switchVideo({
url: videoUrl
});
dp.play();
$("#molist li").eq(i).addClass("on").siblings().removeClass("on");
});
}
$(document).ready(function() {
var iscahid = "1";
$(".list_r").click(function() {
if (iscahid == "1") {
$("#video-list").animate({
left: "0px"
});
$(".list_r").addClass("rotate-180");
iscahid = "0";
} else {
$("#video-list").animate({
left: "-120px"
});
$(".list_r").removeClass("rotate-180");
iscahid = "1";
}
});
console.warn(curri);
$("#molist li").eq(curri).click();
setTimeout(function() {
dp.play();
}, 500)
});
function getParam(paramName) {
paramValue = "", isFound = !1;
if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) {
arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&"), i = 0;
while (i < arrSource.length && !isFound) arrSource[i].indexOf("=") > 0 && arrSource[i].split("=")[0]
.toLowerCase() == paramName.toLowerCase() && (paramValue = arrSource[i].split("=")[1], isFound = !0), i++
}
return paramValue == "" && (paramValue = null), paramValue
}
</script>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
dplayer多视频列表播放
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共14个文件
js:7个
mp4:3个
css:1个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
需积分: 5 0 下载量 85 浏览量
2024-05-27
14:49:08
上传
评论
收藏 69.43MB RAR 举报
温馨提示
dplayer多视频列表轮播,可以根据url参数初始第几个开始播放。播放完自动下一个,也可以选择播放。附带单机服务工具
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083646.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![js](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/EXE.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/MP4.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/MP4.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/MP4.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/HTML.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/PNG.png)
共 14 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/f0d23eac3d5e4147839d64c57a724944_zaq11qazs.jpg!1)
zaq11qazS
- 粉丝: 4
- 资源: 13
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)