1、通过接口可以设置播放器防录屏自定义url跑马灯开关,在开启时需提交url参数。
2、接口URL中的{channelId}为 频道ID
3、接口支持https协议
http://api.polyv.net/live/v2/channelRestrict/{channelId}/set-diyurl-marquee
{
"code": 200,
"status": "success",
"message": "",
"data": "设置成功"
}
{
"code": 400,
"status": "error",
"message": "appId not found.",
"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": "channel not found.",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "marqueeRestrict is wrong",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "url is required",
"data": ""
}
{
"code": 400,
"status": "error",
"message": "设置失败",
"data": ""
}
<?php
//引用config.php
include 'config.php';
//接口需要的参数(非sign)赋值
$channelId = "127075";
$marqueeRestrict = "Y";
$url = "http://demo.polyv.net/wfy/marquee.php";
$params = array(
'appId'=>$appId,
'url'=>$url,
'marqueeRestrict'=>$marqueeRestrict,
'timestamp'=>$timestamp
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
//接口请求url
$url = "http://api.polyv.net/live/v2/channelRestrict/$channelId/set-diyurl-marquee?appId=$appId×tamp=$timestamp&sign=$sign&url=$url&marqueeRestrict=$marqueeRestrict";
//输出接口请求结果
echo file_get_contents($url);
?>