- <html><head> <meta charset="utf-8" /> <title>漂亮小姐姐--在线版</title> <style> .next{ width:120px; height:30px; background:#03a9f4; color:#ffffff; font-size:16px; } .control-box{ margin-top:10px; } .auto{ width:120px; height:30px; background:#ff9800; color:#ffffff; font-size:16px; } .down{ width:120px; height:30px; background:#4caf50; color:#ffffff; font-size:16px; } </style></head><center> <video id="play" controls webkit-playsinline playsinline style="height:720px;"></video> <div class="control-box"> <button id="next" class="next">下一位</button> <button id="auto" class="auto">连续播放</button> <button id="down" class="down">下载当前</button> </div></center><script> var auto = false; window.onload = function(){ init(); } //获取元素 function $(ele){ return document.getElementById(ele); } //启动 function init(){ play(); } function play(){ var url = 'http://v.nrzj.vip/video.php?_t='; var rand = Math.random(); url = url + rand; $('play').src = url; } //控制 $('next').addEventListener('click',function(){ play(); }); //连续 $('play').addEventListener('ended',function(){ if(auto){ play(); } }); //是否开启连续开关 $('auto').addEventListener('click',function(){ if(!auto){ auto = true; this.innerHTML = '停止连续'; $('play').autoplay = true; }else{ auto = false; this.innerHTML = '连续播放'; $('play').autoplay = false; } }); $('down').addEventListener('click',function(){ var url = $('play').src; window.location.href = url; });</script></html>
复制代码 我写了个版本,直接复制之后,把后缀名改成HTML就能运行,比原版的简单(快来夸我几句~~!哈哈哈) |