》》视频

news/2024/7/5 4:01:05
<!DOCTYPE html>
<html><head><meta charset="utf-8" /><title>自定义视频</title><style>* {margin: 0;padding: 0;}@font-face {font-family: "iconfont";src: url('iconfont.eot?t=1501471609099');/* IE9*/src: url('iconfont.eot?t=1501471609099#iefix') format('embedded-opentype'), /* IE6-IE8 */url('iconfont.woff?t=1501471609099') format('woff'), /* chrome, firefox */url('iconfont.ttf?t=1501471609099') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/url('iconfont.svg?t=1501471609099#iconfont') format('svg');/* iOS 4.1- */}.iconfont {font-family: "iconfont" !important;font-size: 16px;font-style: normal;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}ul {list-style-type: none;}body {width: 100vw;height: 100vh;background: url(img/bg.jpg)center;background-size: cover;}.v-bg {width: 100vw;height: 100vh;position: relative;top: 0;left: 0;right: 0;bottom: 0;background: rgba(0, 0, 0, 0.6);}.video-box {position: absolute;left: 50%;top: 50%;width: 600px;height: 300px;margin-left: -300px;margin-top: -200px;font-size: 0;-webkit-user-select: none;}.v-control {position: relative;height: 50px;background-color: rgba(0, 0, 0, 0.8);transition: all 0.3s linear;}.v-jdt {position: absolute;bottom: 50px;left: 0;right: 0;height: 5px;background-color: rgba(255, 255, 255, 0.3);transition: height 0.3s linear;overflow: hidden;}.video-box:hover .v-jdt {height: 10px;}.v-jd {position: absolute;left: 0;width: 0;height: 10px;background-color: orange;}.v-range {position: absolute;left: 0;width: 10px;height: 10px;border-radius: 50%;display: none;background-color: #FFF;box-shadow: 0 0 5px 2px orange;}.video-box:hover .v-range {display: block;}.v-bar {position: relative;line-height: 50px;}.v-bar li {position: absolute;font-size: 20px;cursor: pointer;color: #FFF;}.v-bar li:not(:nth-child(3)):hover {color: orange;}.v-bar li:nth-child(1) {left: 15px;}.v-bar li:nth-child(2) {left: 48px;}.v-bar li:nth-child(3) {left: 88px;font-size: 12px;}#all-time {color: #999;}.v-bar li:nth-child(4) {right: 48px;}.v-bar li:nth-child(5) {right: 15px;}.v-bar li:nth-child(4):hover .volum-bar {display: block;}.volum-bar {position: absolute;bottom: 50px;left: -5px;width: 25px;height: 100px;background-color: rgba(0, 0, 0, 0.3);display: none;}.volum-bar div {position: relative;width: 5px;height: 90px;border-radius: 3px;margin: 0 auto;margin-top: 5px;background-color: #FFF;transform: rotate(180deg);}.volum-bar div i {position: absolute;width: 10px;height: 10px;border-radius: 50%;background-color: #FFF;left: 10px;margin-left: -13px;top: 0;}</style></head><body><div class="v-bg"><div class="video-box"><video width="600" id="video"><source src="video/yuebing.mp4" type="video/mp4"></source></video><div class="v-control"><div class="v-jdt" id="jdt"><div class="v-jd" id="jd"></div><div class="v-range" id="range"></div></div><ul class="v-bar"><li id="paly-pause" class="iconfont">&#xe60e;</li><li id="next" class="iconfont">&#xe61b;</li><li><span id="current-time">00:00</span>&ensp;/&ensp;<span id="all-time">18:56</span></li><li class="iconfont"><span id="volum-m">&#xe617;</span><div class="volum-bar"><div id="volum"><i id="volum-btn"></i></div></div></li><li class="iconfont" id="full">&#xe69a;</li></ul></div></div></div></body><script>var video = document.getElementById("video");var play_pause = document.getElementById("paly-pause");var currentTime = document.getElementById("current-time");var allTime = document.getElementById("all-time");var v_jdt = document.getElementById("jdt");var v_jd = document.getElementById("jd");var v_range = document.getElementById("range");var volum = document.getElementById("volum");var v_btn = document.getElementById("volum-btn");var volum_m = document.getElementById("volum-m");var full = document.getElementById("full");var contorl = document.getElementsByClassName("v-control");if(video.autoplay) {play_pause.innerHTML = "&#xe611;";}video.poster.src = "";video.addEventListener("canplay", function() {play_pause.onclick = function() {if(video.paused) {video.play();this.innerHTML = "&#xe611;";} else {video.pause();this.innerHTML = "&#xe60e;";}}allTime.innerText = toMS(video.duration);video.addEventListener("timeupdate", function() {currentTime.innerText = toMS(video.currentTime);v_jd.style.width = (video.currentTime / video.duration) * 100 + "%";v_range.style.left = (video.currentTime / video.duration) * 100 + "%";});}, false);v_jdt.onclick = function(e) {var e = e || window.event;var target = e.target || e.srcElement;if(target.id == "jdt" || target.id == "jd") {var x = e.offsetX;var w = this.offsetWidth;v_jd.style.width = (x / w) * 100 + "%";v_range.style.left = (x / w) * 100 + "%";video.currentTime = video.duration * (x / w);}}volum.onclick = function(e) {var e = e || window.event;var target = e.target || e.srcElement;if(target.id == "volum") {var y = e.offsetY;var h = this.offsetHeight;video.volume = (y / h);v_btn.style.top = (y / h) * 100 + "%";if(video.volume == 0) {volum_m.innerHTML = "&#xe63a;";video.muted = true;} else {volum_m.innerHTML = "&#xe617;";video.muted = false;}}}volum_m.onclick = function() {if(video.muted) {this.innerHTML = "&#xe617;";video.muted = false;} else {this.innerHTML = "&#xe63a;";video.muted = true;}}full.onclick = function() {if(video.mozRequestFullScreen) {video.mozRequestFullScreen();} else if(video.webkitRequestFullScreen) {video.webkitRequestFullScreen();} else if(video.msRequestFullScreen) {video.msRequestFullscreen();} else {video.requestFullscreen();}contorl.style.width = 100 + "%";contorl.style.height = 100 + "%";contorl.style.zindex = "50";}function toMS(time) {var m = Math.floor(time / 60);m = (m > 9) ? m : "0" + m;var s = Math.floor(time % 60);s = (s > 9) ? s : "0" + s;return m + ":" + s;}</script></html>

 

转载于:https://www.cnblogs.com/1007573044qqcom/p/7993227.html


http://lihuaxi.xjx100.cn/news/248477.html

相关文章

5.matlab 中的sort

&#xff08;1&#xff09;sort的功能就会排序 默认情况使用升序sort &#xff08;X&#xff0c;DIM&#xff0c;MoDE&#xff09; x是排序的变量 DIM是维度&#xff0c;也就是依据那个维度排序 MORE是排序的方向&#xff1a; ascend 升序 descend降序 &#xff…

Eigen位姿表示

Eigen有多种位姿表示方法&#xff0c;下面依次介绍 1. Isometry3d // 虽然称为3d&#xff0c;实质上是4&#xff0a;4的矩阵&#xff0c;齐次坐标 Eigen::Isometry3d Tc1w Eigen::Isometry3d::Identity();// 按照rotation_matrix进行旋转 Tc1w.rotate(rotation_matrix);// 把…

动软代码生成V2.74模版简介

最近发现很多人用动软代码生成&#xff0c;确实方便&#xff0c;有些经验记录下&#xff0c;以后查看回顾。 ..\Maticsoft\Codematic2\Template\TemplateFile 为模板文件夹&#xff0c;直接在目录下新建文件夹【我的自定义模版】,有个【模版示例.cmt】也直接复制到自定义文件下…

mysql (双主,互主)

Master-Master&#xff08;双主&#xff09; 1、测试环境 Master/Slave Master1/Slave1 IP 192.168.1.13 192.168.1.10 为了保持干净的环境&#xff1a;两边服务器 rm -rf /var/lib/mysql/* service mysqld re…

6. matlab中case语句的使用

&#xff08;1&#xff09;单个的就如同C语言中的一样&#xff0c;不过在和switch使用的时候case后不用接&#xff1a; n input(Enter a number: );switch ncase -1disp(negative one)case 0disp(zero)case 1disp(positive one)otherwisedisp(other value) end&#xff08;2&a…

matplotlib使用笔记

1. 简要介绍 matplotlib是一个用于画图的Python开源库&#xff0c;提供了强大的画图功能 与MATLAB相比 功能类似&#xff0c;但使用上逊于MATLAB。尤其在数据量很大时&#xff0c;画出的图卡顿很严重&#xff0c;远逊于MATLAB 与Excel相比 如果只画一次图&#xff0c;Excel更…

Bootstrap3.x - 源代码分析

参照http://v3.bootcss.com/css/ 文档与源代码colors 比较全面定义总结有意义的颜色。所有uI要用的颜色&#xff0c;都先从已定义的读&#xff0c;这样保证样式的同一性&#xff0c;而且方便以后开发主题库。(建议想自己写css模块的&#xff0c;可以参考一下bootstrap里颜色定义…

Word 2003文件保存和另存为操作是否熟练掌握的有关测试

提出问题本文内容不仅适用于Word&#xff0c;对于其他的文档&#xff08;文字、图形、动画、声音等&#xff09;编辑软件基本通用。对于操作上述各种编辑软件时&#xff0c;大家都应该注意到&#xff0c;我们第一次保存文件时系统出现的是“另存为”对话框。此后&#xff0c;再…