网络代码!手机端浏览器有BUG,QQ,微信和电脑能正常观看
代码展示:
HTML:
<body>
<section id="main">
<video id="player" src="video.php?lx=video" controls autoplay webkit-playsinline playsinline></video>
</section>
<section id="buttons">
<button id="switch">连续: 开</button>
<button id="next">播放下一个</button>
</section>
</body>
CSS:
#main {
display: flex;
justify-content: center;
align-items: center;
}
#player {
width: 100%;
height: auto;
max-height: 100%;
}
#buttons {
display: flex;
flex-direction: row;
justify-content: space-evenly;
align-items: center;
height: 60px;
padding: 10px;
}
#switch,
#next,
#qh {
background: #FFC0CB;
color: #000000;
font-size: 16px;
font-weight: bold;
height: 40px;
padding: 0px 20px;
margin: 0px 5px;
border-radius: 20px;
}
JavaScript:
(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 type = true;
var player = get('player');
var randomm = function () {
player.src = 'video.php?lx=video';
player.play();
}
bind(get('next'), '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);
PHP:
<?php
if($_GET['lx']=="video"){
$content = file_get_contents("http://api.xiao-xin.top/API/kuaishou.php?type=json");
$json = json_decode($content,true);
header("Location: {$json['video_url']}");}
if($_GET['lx']!="video"){
$content = file_get_contents("http://api.xiao-xin.top/API/kuaishou_png.php?type=json");
$json = json_decode($content,true);
header("Location: {$json['png_url']}");}
© 版权声明
本站网络名称:
蚩梦博客
本站永久网址:
https://chimengblog.com/
网站侵权说明:
本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长QQ45096653删除处理。
1 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
2 本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
3 本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
1 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
2 本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
3 本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
THE END
- 最新
- 最热
只看作者