<div> <section id="main"><video id="player" src="http://v.nrzj.vip/video.php" controls="controls" width="100%" height="400px"></video></section> </div> <div> <section id="buttons"><button id="switch">连续: 开</button> <button id="next1">播放下一个</button></section> </div> <p> <script> (function (window, document) { if (top != self) { window.top.location.replace(self.location.href); } var get = function (id) { return document.getElementById(id); } var bind = function (element, event, callback) { return element.addEventListener(event, callback); } var auto = true; var player = get('player'); var randomm = function () { player.src = 'http://v.nrzj.vip/video.php?_t=' + Math.random(); player.play(); } bind(get('next1'), 'click', randomm); bind(player, 'error', function () { randomm(); }); bind(get('switch'), 'click', function () { auto = !auto; this.innerText = '连续: ' + (auto ? '开' : '关'); }); bind(player, 'ended', function () { if (auto) randomm(); }); })(window, document); </script> </p>
复制上面的代码贴到你的网站就好啦。
不过视频源是别人的。随时可能会失效哈。
哈哈哈,我说怎么多了个小姐姐
圖片源頭在哪裏
收藏收藏