发信息做推广,我选黔优网

发布产品信息
微信公众号 微信公众号

HTML5video标签使用JS控制视频效果案例

我要举报 黔优网官方账号 时间:2024-12-17 17:39 浙江浏览量:62|  阅读时长:7分钟
导读:很多小伙伴们都有在网页中进行观看视频的习惯,那么大家知道这是怎么进行播放的吗?那么今天我们就来说说:“HTML5中视频播放(video)和JavaScript控制视频效果怎么实现?”这个问题吧!具体代码如下所示:htmlheadme

很多小伙伴们都有在网页中进行观看视频的习惯,那么大家知道这是怎么进行播放的吗?那么今天我们就来说说:“HTML5中视频播放(video)和JavaScript控制视频效果怎么实现?”这个问题吧!

具体代码如下所示:

<html>
<head>
<meta charset="UTF-8">
<title>Documenttitle>
<style>
figcaption {
text-align: center;
line-height: 150px;
font-family: "Microsoft Yahei";
font-size: 24px;
}
.player {
width: 720px;
height: 360px;
margin: 10px auto;
border: 1px solid #000;
background-color: #000;
position: relative;
border-radius: 6px;
}
.player video {
width: 720px;
height: 360px;
}
.controls {
width: 700px;
height: 40px;
background-color: rgba(255,255,0,0.3);
position: absolute;
bottom: 10px;
left: 10px;
border-radius: 10px;
}
.switch {
position: absolute;
width: 22px;
height: 22px;
background-color: red;
left: 10px;
top: 9px;
border-radius: 50%;
}
.progress {
width: 432px;
height: 10px;
position: absolute;
background-color: rgba(255,255,255,0.4);
left: 40px;
top: 15px;
border-radius: 4px;
overflow: hidden;
}
.curr-progress {
width: 0%;
height: 100%;
background-color: #fff;
}
.time {
width: 120px;
height: 20px;
text-align: center;
line-height: 20px;
font-size: 12px;
color: #fff;
position: absolute;
left: 510px;
top: 10px;
}
.extend {
position: absolute;
width: 20px;
height: 20px;
background-color: red;
right: 10px;
top: 10px;
}
style>
head>
<body>
<figure>  
<figcaption>视频案例figcaption>
<div>
<video src=https://www.qianu.com/static/image/nopic320.png>

总结

通过这篇文章的分享,想必到大家对于:“HTML5中视频播放(video)和JavaScript控制视频效果怎么实现?”这个问题有所了解了吧!当然更多有关于html5这方面的内容我们都可以在W3Cschool中进行学习和了解。

 
  • 下一篇: Python实现地图可视化?folium介绍!
  • 上一篇: 通过html5实现拼图功能效果?canvas实现拼图案例分享!
 
没用 0举报 收藏 0评论 0
免责声明:
本页信息由“黔优网官方账号”发布,黔优网作为免费B2B信息发布平台,已对用户身份进行实名验证并对内容进行形式审核。信息的真实性、合法性由发布者独立承担全部责任,平台不承担内容准确性保证责任。本文涉及见解与观点不代表黔优网官方立场,交易决策前请务必自行核实,风险自负。原文链接:https://www.qianu.com/n/694607.html。如发现侵权或虚假内容,请【投诉举报】联系我们处理。
 
 

 
推荐图文资讯