一款播放小姐姐的试用品播放器源码。
源码下载
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/*按钮样式*/
.btn {
--hue: 190;/*删除主题按钮复原*/
position: relative;
padding: 1rem 3rem;
font-size: 1rem;
line-height: 1.5;
color: black;
text-decoration: none;
text-transform: uppercase;
background-color: hsl(var(--hue), 100%, 41%);
border: 1px solid hsl(var(--hue), 100%, 41%);
outline: transparent;
overflow: hidden;
cursor: pointer;
user-select: none;
white-space: nowrap;
transition: 0.25s;
}
.btn:hover {
background: hsl(var(--hue), 100%, 31%);
}
.btn-primary {
--hue: 187;/*删除主题按钮复原*/
}
.btn-ghost {
color: hsl(var(--hue), 100%, 41%);
background-color: transparent;
border-color: hsl(var(--hue), 100%, 41%);
}
.btn-ghost:hover {
color: black;
}
.btn-shine {
color: lightblue;
}
.btn-shine::before {
position: absolute;
content: "";
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(120deg, transparent, hsla(var(--hue), 100%, 41%, 0.5), transparent);
transform: translateX(-100%);
transition: 0.6s;
}
.btn-shine:hover {
background: transparent;
box-shadow: 0 0 20px 10px hsla(var(--hue), 100%, 41%, 0.5);
}
.btn-shine:hover::before {
transform: translateX(100%);
}
/*播放器*/
.container {
text-align: center;
}
.video {
width: 60%;/*修改比例可决定播发器大小*/
border-radius: 10px;
}
.controls {
margin-top: 20px;
}
</style>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>/*引入在线jquery*/
</head>
<body>
<div class="container">
<video id="videoPlayer" class="video" autoplay muted>
<source src="https://api.yujn.cn/api/zzxjj.php?type=video" type="video/mp4">
您的浏览器不支持视频标签。
</video>
<div class="controls">
<button id="playBtn" class="btn btn-primary btn-ghost btn-shine">接着舞</button>
<button id="pauseBtn" class="btn btn-primary btn-ghost btn-shine">暂停</button>
<button id="nextBtn" class="btn btn-primary btn-ghost btn-shine">寡人不满意</button>
</div>
</div>
<script>$(document).ready(function () {
const videoPlayer = $('#videoPlayer').get(0); // 获取video元素
$('#playBtn').click(function () {
videoPlayer.play(); // 播放视频
});
$('#pauseBtn').click(function () {
videoPlayer.pause(); // 暂停视频
});
$('#nextBtn').click(function () {
// 这里可以加载下一首视频
document.getElementById('videoPlayer').src = 'https://api.yujn.cn/api/zzxjj.php?type=video';
});
});</script>
</body>
</html>
页:
[1]