无为清净楼资源网 Design By www.qnjia.com
效果:
代码很简单
js
define("html5_video_player", [ '../avalon-min'], function(avalon) { function formatTime(seconds) { var seconds = Math.round(seconds); var minutes = Math.floor(seconds / 60); seconds = Math.floor(seconds % 60); minutes = (minutes >= 10) "0" + minutes; seconds = (seconds >= 10) "0" + seconds; return minutes + ":" + seconds; } var playing=false,mute=false,vol=50,fs=false,active=false,inactivityTimeout=timer=null; avalon.bind($('control_btn'),'click',function(){ if(!playing){ $('html5_video').play(); $('control_btn').className='html5_video_pause_btn inline-block'; playing=true; }else{ $('html5_video').pause(); $('control_btn').className='html5_video_play_btn inline-block'; playing=false; } }); avalon.bind($('video_bar'),'click',function(e){ var a=(e.clientX-$('video_bar').offsetLeft)/$('video_bar').offsetWidth; $('html5_video').currentTime =a.toFixed(2)*$('html5_video').duration; }); avalon.bind($('vol_bar'),'click',function(e){ var a=(e.clientX-$('vol_bar').offsetLeft-8)/$('vol_bar').offsetWidth; vol=$('html5_video').volume =a; $('vol_value').style.width=a*100+'%'; }); avalon.bind($('mute_icon'),'click',function(){ if(!mute){ $('html5_video').volume=0; $('mute_icon').className='html5_video_mute1'; mute=true; }else{ $('html5_video').volume=vol; $('mute_icon').className='html5_video_mute'; mute=false; } }); avalon.bind($('html5_video'),'loadedmetadata',function(){ $('html5_video_duration').innerHTML=formatTime($('html5_video').duration); $('html5_video').volume=0; }); avalon.bind($('html5_video'),'timeupdate',function(){ $('html5_play_time').innerHTML=formatTime($('html5_video').currentTime); $('video_progress_bar').style.left=$('html5_video').currentTime/$('html5_video').duration*100+'%'; }); avalon.bind($('html5_video_fullscreen'),'click',function(e){ if(!fs){ toggle_fullscreen(); }else{ exit_fullscreen(); } }); document.onmozfullscreenchange = function() { if ($('html5_video').clientWidth +2!= document.documentElement.clientWidth) { exit_fullscreen(); } }; document.onwebkitfullscreenchange = function() { if ($('html5_video').clientWidth!= document.documentElement.clientWidth) { exit_fullscreen(); } }; function exit_fullscreen() { $('html5_video').className=''; fs = false; active=false; $('video_control').className=''; if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } } function toggle_fullscreen() { $('html5_video').className='video_fs'; fs = true; $('video_control').className='fullscreen'; var elem=$('html5_video'); if (elem.msRequestFullscreen) { elem.msRequestFullscreen(); } else if (elem.mozRequestFullScreen) { elem.mozRequestFullScreen(); } else if (elem.webkitRequestFullscreen) { elem.webkitRequestFullscreen(); } } function updateBuffered() { var v = $('html5_video'); var r = v.buffered; if (r) { for (var i=0; i<r.length; i++) { var start = r.start(i); var end = r.end(i); } $('video_buffer_bar').style.width=end/$('html5_video').duration*100+'%'; } } setInterval(updateBuffered,500); function b(){ if(active){ $('video_control').style.display='none'; active=false; console.log(active); } } avalon.bind($('html5_video'),'mousemove',function(e){ if(fs){ clearTimeout(inactivityTimeout); active=true; $('video_control').style.display='block'; inactivityTimeout = setTimeout(b, 5000); } }); });
html
<link type="text/css" href="http://localhost/twitter/css/html5_video_player.css" rel="stylesheet" /> <div id='wrap_html5_video'> <div id='html5_video_area'> <video id="html5_video" width="360" height="240"> <source type=" video/mp4" src="/UploadFiles/2021-04-02/2.mp4">css
@CHARSET "UTF-8"; #wrap_html5_video { padding: 10px; width: 360px; } #vol_bar,#video_bar,#vol_value { height: 9px; background-color: #999999; } #vol_bar { width: 100px; cursor: pointer; } #vol_value { background-color: #179df7; width: 50%; } #html5_video { display: block; border: 1px solid #c0deed; } #video_buffer_bar { background-color: #179DF7; width: 0; } #video_progress_bar,#video_buffer_bar { position: absolute; height: 100%; } #video_progress_bar { background-color: #0066FF; width: 2px; left: 0; } .html5_video_pause_btn,.html5_video_play_btn { width: 40px; height: 40px; cursor: pointer; } .html5_video_play_btn { background: url("http://localhost/twitter/images/html5_video.jpg") 0 0 no-repeat; } .html5_video_play_btn:hover { background: url("http://localhost/twitter/images/html5_video.jpg") -41px 0 no-repeat; } .html5_video_pause_btn { background: url("http://localhost/twitter/images/html5_video.jpg") 0 -42px no-repeat; } .html5_video_pause_btn:hover { background: url("http://localhost/twitter/images/html5_video.jpg") -41px -42px no-repeat; } #play_control a,#vol_bar { vertical-align: middle; } #html5_video_fullscreen { width: 25px; background: url("http://localhost/twitter/images/html5_video.jpg") 0 -310px no-repeat; height: 18px; } #play_control #html5_video_time { font-size: 14px; } #play_control li,#play_control ul { font-size: 0; } #play_control li:last-child { position: absolute; right: 0; } .html5_video_mute1 { background: url("http://localhost/twitter/images/html5_video.jpg") no-repeat scroll -79px -170px rgba(0, 0, 0, 0); } .html5_video_mute { background: url("http://localhost/twitter/images/html5_video.jpg") no-repeat scroll 0 -170px rgba(0, 0, 0, 0); } #mute_icon { cursor: pointer; display: inline-block; height: 15px; width: 18px; } .html5_video_mute:hover { background: url("http://localhost/twitter/images/html5_video.jpg") -19px -170px no-repeat; } #play_control li { height: 40px; vertical-align: top; margin: 0 5px; } #play_control li:after { display: inline-block; width: 0; height: 100%; vertical-align: middle; content: ''; } #play_control,#video_bar,#vol_bar { position: relative; } body .fullscreen { position: fixed; left: 0; bottom: 0; width: 100%; overflow: hidden; z-index: 2147483647; background-color: #fff; } video::-webkit-media-controls { display: none !important; }
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!
昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。
这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。
而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?
更新日志
2024年11月19日
2024年11月19日
- 证声音乐图书馆《海风摇曳·盛夏爵士曲》[320K/MP3][63.06MB]
- 龚玥《金装龚玥HQCD》头版限量[WAV分轨]
- 李小春《吻别》萨克斯演奏经典[原抓WAV+CUE]
- 齐秦《辉煌30年24K珍藏版》2CD[WAV+CUE]
- 证声音乐图书馆《海风摇曳·盛夏爵士曲》[FLAC/分轨][321.47MB]
- 群星 《世界经典汽车音乐》 [WAV分轨][1G]
- 冷漠.2011 《冷漠的爱DSD》[WAV+CUE][1.2G]
- 陈明《流金岁月精逊【中唱】【WAV+CUE】
- 群星《Jazz-Ladies1-2爵士女伶1-2》HQCD/2CD[原抓WAV+CUE]
- 群星《美女私房歌》(黑胶)[WAV分轨]
- 郑源.2009《试音天碟》24BIT-96KHZ[WAV+CUE][1.2G]
- 飞利浦试音碟 《环球群星监听录》SACD香港版[WAV+CUE][1.1G]
- 车载音乐最强享受《车载极致女声精选CD》[WAV分轨][1G]
- 童宇.2024-爱情万年历【TOUCH音乐】【FLAC分轨】
- 黄晓君.2010-丽风金典系列VOL.1.2CD【丽风】【WAV+CUE】