很多人都不会整合m3u8视频,这里分享下整合的方法.
调用方式:文件保存为1.php 编码注意要UTF8
调用格式:php.php?v=http://www.vlwx.com/shiping.m3u8
m3u8直连
<?php
error_reporting(0);
header("Content-Type: text/html; charset=utf-8"); // 设置网页编码,根据实际需要修改
$v=$_GET["v"];
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<title>天赐解析调用演示</title>
<style type="text/css">body,html,div{padding: 0;margin: 0;width:100%;height:100%;}</style>
</head>
<body>
<div id="a1"></div>
<script type="text/javascript" src="/ckplayer.js" charset="utf-8"></script>
<script type="text/javascript">
var flashvars={
f: '/m3u8.swf', //使用swf向播放器发送视频地址进行播放
a: '<?php echo $v ?>',
c: 0, //调用 ckplayer.js 配置播放器
p: 1, //自动播放视频
s: 4, //flash插件形式发送视频流地址给播放器进行播放
lv: 0
};
var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent'};
var isiPad = navigator.userAgent.match(/iPad|iPhone|Linux|Android|iPod/i) != null;
if (isiPad) {
document.getElementById('a1').innerHTML = '<video src="<?php echo $v ?>" controls="controls" autoplay="autoplay" width="100%" height="230"></video>'
}else{
CKobject.embedSWF('/ckplayer.swf','a1','ckplayer_a1','100%','100%',flashvars,params);
}
</script>
</body>
</html>