1、通过用户id,查询播放器列表
2、接口URL中的{userid}为点播账号userid,具体参考菜单【使用须知】->【获取密钥】
3、接口支持https协议
http://api.polyv.net/v2/play/{userid}/player-list
http://api.polyv.net/v2/play/1b448be323/player-list?sign=1E3CFEEC4EA888571A84156E5BF57EBB35ECAA72&userid=1b448be323&ptime=1617845463779
强烈建议您使用点播Java SDK完成API的功能对接,点播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(VodVideoPlayerTest.class);
/**
* 查询播放器列表
*/
@Test
public void testGetPlayerList() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String secretKey = super.secretKey;
String userId = super.userId;
String ptime = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v2/play/" + userId + "/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 somethings
}
{
"code": 200,
"status": "success",
"message": "success",
"data": [
{
"playerName": "默认播放器-红色",
"playerId": "MDL7ARoayp",
"date": "2021-04-02 11:53:44",
"isDefault": 1
},
{
"playerName": "创建的播放器",
"playerId": "d4b8dDzXsT",
"date": "2021-03-30 11:38:33",
"isDefault": 0
},
{
"playerName": "默认播放器",
"playerId": "1b448be323",
"date": "2020-09-28 14:17:08",
"isDefault": 0
}
]
}
{
"code": 400,
"status": "error",
"message": "sign can not be empty.",
"data": ""
}