保利威文档中心

幫助中心

設定播放器自訂 URL 跑馬燈

更新時間:2026-01-28 18:58:52

介面描述

1、通过接口可以设置播放器内容保护自定义url跑马灯开关,在开启时需提交url参数。
2、接口URL中的{channelId}为 频道ID
3、接口支持https协议

介面 URL

http://api.polyv.net/live/v2/channelRestrict/{channelId}/set-diyurl-marquee

請求方式

GET,POST

具體請參考自訂 URL 跑馬燈.

支援格式

JSON

請求數限制

TRUE

請求參數

參數名 必選 類型 說明
appId string 從 API 設定中取得,在直播系統登記的 appId
timestamp string 目前 13 位毫秒級時間戳記,3 分鐘內有效
marqueeRestrict Y 或 N 自訂 URL 內容保護跑馬燈開關
url string 自訂 URL,在開關為關時可為空,開啟開關時為必填
sign string 簽名,32 位大寫 MD5 值

響應成功 JSON 範例:

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": "设置成功"
}

響應失敗 JSON 範例:

未輸入 appId

{
    "code": 400,
    "status": "error",
    "message": "appId not found.",
    "data": ""
}

appId 不正確

{
    "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": ""
}

跑馬燈開關為開時,未提交自訂 URL

{
    "code": 400,
    "status": "error",
    "message": "url is required",
    "data": ""
}

其他情況

{
    "code": 400,
    "status": "error",
    "message": "设置失败",
    "data": ""
}

欄位說明

參數名 說明
code 請求結果代碼,成功為 200
status 請求結果,成功時為 "success",錯誤時為 "error"
message 錯誤資訊,請求成功時為空,錯誤時為錯誤資訊

php 請求範例

<?php

//引用config.php
include 'config.php';

//接口需要的参数(非sign)赋值
$channelId = "127075";
$marqueeRestrict = "Y";
$url = "http://demo.ipolyv.cn/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&timestamp=$timestamp&sign=$sign&url=$url&marqueeRestrict=$marqueeRestrict";

//输出接口请求结果
echo file_get_contents($url);

?>

簽名規則 (config.php 檔案程式碼檢視)

簽名產生規則

联系客服,在线咨询