https://api.polyv.net/live/v3/channel/detail/get-pull-url
1、获取频道的拉流地址
2、接口支持https协议
{
"code": 200,
"status": "success",
"message": "",
"data": {
"flv": "https://pull-huk.videocc.net/recordf/1c6dc3c666201909261628019107.m3u8?auth_key=1584335309-0-0-c0017cb24300497adb87aee6f617fdbd",
"m3u8": "https://pull-huk.videocc.net/recordf/1c6dc3c666201909206162819107.flv?auth_key=1584335309-0-0-7e5e327553f6800c148a485b6a8fff58"
}
}
{
"code": 400,
"status": "error",
"message": "appId is required.",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "application not found.",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "invalid timestamp.",
"data": ""
}
{
"code": 403,
"status": "error",
"message": "invalid signature.",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "illegal operation.",
"data": ""
}
<?php
//引用config.php
include 'config.php';
/接口需要的参数(非sign)赋值
$params = array(
'appId'=>$appId,
'channelId'=>$channelId,
'timestamp'=>$timestamp
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
//接口请求url
$url = "http://api.polyv.net/live/v3/channel/detail/get-pull-url?appId=".$appId."×tamp=".$timestamp."&sign=".$sign."&channelId=".$channelId;
//输出接口请求结果
echo file_get_contents($url);
?>