1、修改播放器logo图片
2、接口URL中的{channelId}为 频道ID
3、接口支持https协议
http://api.polyv.net/live/v2/channels/{channelId}/update
{
code: 200,
status: "success",
message: "",
data: true
}
{
code: 400,
status: "error",
message: "invalid timestamp.",
data: ""
}
<?php
//引用config.php
include 'config.php';
//接口需要的参数(非sign)赋值
$channelId = "127075";
$logoImage = "http://demo.polyv.net/wfy/live/logo.jpg"; //播放器封面图
$logoOpacity = "0.5"; //透明度,取值范围为(0,1]
$logoPosition = "tr"; //图片位置,取值为左上(tl)、右上(tr)、左下(bl)、右下(br)
$logoHref ="http://www.polyv.net"; //图片点击跳转链接
$params = array(
'appId'=>$appId,
'logoImage'=>$logoImage,
'logoOpacity'=>$logoOpacity,
'logoPosition'=>$logoPosition,
'logoHref'=>$logoHref,
'timestamp'=>$timestamp
);
//生成sign
$sign = getSign($params); //详细查看config.php文件的getSign方法
//接口请求url
$url = "http://api.live.polyv.net/v2/channels/$channelId/update?appId=$appId×tamp=$timestamp&logoHref=$logoHref&logoImage=$logoImage&logoOpacity=$logoOpacity&logoPosition=$logoPosition&sign=$sign";
$ch = curl_init() or die ( curl_error() );
curl_setopt( $ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 360);
$response = curl_exec ( $ch );
curl_close ( $ch );
echo $response;
?>