YY直播接口只要修改相应的房间号就行
1、第一种接口 适合电脑【flash】模式
<embed align="middle" allowfullscreen="true" allowscriptaccess="always" height="267px" mode="transparent" quality="high" src="http://yy.com/s/22490906/22490906/yyscene.swf" type="application/x-shockwave-flash" width="333px"></embed>
2、第二种接口 适应所有端 【接口模式】+ckplayer
<?php
//房间号
$a="1350249959/1350249959";
$ch = curl_init();
//接口1-能用
#curl_setopt($ch,CURLOPT_URL,"http://interface.yy.com/hls/get/0/".$a."?appid=0&excid=1200&type=m3u8&isHttps=0&callback=jsonp2");
//接口2-能用
curl_setopt($ch,CURLOPT_URL,"http://interface.yy.com/hls/new/get/".$a."/1200?source=wapyy&callback=jsonp2");
$headx = array();
$headx[] = 'Referer: http://interface.yy.com/';
curl_setopt($ch,CURLOPT_HTTPHEADER,$headx);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);//这个是重点
$x=curl_exec($ch);
curl_close($ch);
//变量X 保存yy的jsonp
?>
<script type="text/javascript" src="ckplayer/ckplayer.js"></script>
<div class="video" style="width:100%;height:35%;"></div>
<script type="text/javascript">
function jsonp2(data){
var videoObject = {
container: '.video',
variable: 'player',
autoplay:true,
live:true,
adpause:'gtw.jpg',
adpauselink:'http://gy7.org',
video: data.hls
};
var player=new ckplayer(videoObject);
}
<?php echo $x;?>;
//播放器初始化 靠变量X的 jsonp
</script>