Query Player List
Updated: 2025-02-19 15:21:30
API Description
查询账号下的全部播放器信息
API URL
http://api.polyv.net/v2/player/list
Request Method
GET
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| userid | true | String | Account ID |
| ptime | true | Long | Current time in milliseconds timestamp, valid for 3 minutes |
| sign | true | String | Signature, a 40-character uppercase SHA1 value. The secretkey used to generate the signature is critical for communication data security. It must never be used directly on the client side. All APIs must be called through your own server to relay requests to the POLYV server for response data. See signature generation rules |
Example
http://api.polyv.net/v2/player/list?userid=abcde12345sign=F809B946258A112A78627A832B1F6A7D&ptime=1617845463779
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code, 200 for success, non-200 for failure See global error description |
| status | String | Response status text |
| message | String | Response description message, provides error details when code is 400 or 500 |
| data | Array | Returns player list information on success [See data field description](/vod/api/player/player_list.md?id=data字段说明], returns empty on failure |
data Field Description
| Field | Type | Description |
|---|---|---|
| playerId | String | Player ID, e.g., "1b448be323" |
| playerName | String | Player name |
| isDefault | Integer | Whether it is the default player, 1: yes, 0: no |
| updateTime | String | Last update time, e.g., "2025-02-18 14:51:36" |
| skin | Object | Player skin settings, see skin field description |
| logo | Object | Player logo settings, see logo field description |
| teaserTrailer | Object | Player teaser/trailer settings, see teaserTrailer field description |
skin Field Description
| Field | Type | Description |
|---|---|---|
| skinTheme | String | Skin theme skin_blue: Simple Elegant Black skin_gold: Noble Gold skin_green: Fresh Green skin_red: Vibrant Red |
| skinColor | String | Skin color, e.g., "#03a9f4" |
| skinColorApplyType | String | Skin color application type panel: Panel control: Control bar |
| skinControlLocation | String | Control bar location 0: Not displayed 1: Inside video 2: Outside video |
logo Field Description
| Field | Type | Description |
|---|---|---|
| logoImageUrl | String | Logo image URL |
| logoLinkUrl | String | Logo click redirect URL |
| logoOpacity | Integer | Logo opacity, 0~100 |
| logoDisplayLocation | Integer | Logo display location 0: Not displayed 1: Top left 2: Top right 3: Bottom left 4: Bottom right |
teaserTrailer Field Description
| Field | Type | Description |
|---|---|---|
| teaserShow | Integer | Whether to show teaser, 1: show, 0: hide |
| teaserMediaUrl | String | Teaser video or image URL |
| teaserPlayTime | Integer | Teaser play duration (seconds) |
| trailerShow | Integer | Whether to show trailer, 1: show, 0: hide |
| trailerMediaUrl | String | Trailer video or image URL |
| trailerPlayTime | Integer | Trailer play duration (seconds) |
Java Request Example
For quick integration of basic code, download the relevant dependency source code. Click to download source code. After downloading, add it to your own source project. The HttpUtil.java and VodSignUtil.java in the test cases are included in the download file.
It is strongly recommended to use the VOD Java SDK for API integration. The VOD Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.
private static final Logger log = LoggerFactory.getLogger(VodVideoPlayerTest.class);
/**
* 查询播放器列表
*/
@Test
public void testPlayerList() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = "xxx";
String userid = "xxx";
String ptime = String.valueOf(System.currentTimeMillis());
String url = "http://api.polyv.net/v2/player/list";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("userid", userid);
requestMap.put("ptime", ptime);
requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
String response = HttpUtil.get(url, requestMap);
log.debug("测试查询播放器列表,{}", response);
//do something
}
Response Example
For global error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"message": "success",
"data": [
{
"playerId": "abcde12345",
"playerName": "默认播放器",
"isDefault": 1,
"updateTime": "2025-02-18 14:51:36",
"skin": {
"skinTheme": "skin_red",
"skinColor": "#d1d1d1",
"skinColorApplyType": "panel",
"skinControlLocation": 2
},
"logo": {
"logoImageUrl": "https://img.videocc.net/xxx.jpg",
"logoLinkUrl": "http://www.polyv.net",
"logoOpacity": 100,
"logoDisplayLocation": 1
},
"teaserTrailer": {
"teaserShow": 0,
"teaserMediaUrl": "",
"teaserPlayTime": 0,
"trailerShow": 0,
"trailerMediaUrl": "",
"trailerPlayTime": 0
}
}
]
}
Error Example
{
"code": 400,
"status": "error",
"message": "the sign is not right.",
"data": ""
}
