https://api.polyv.net/live/v3/channel/stream/get-push-url
1、接口用于获取频道推流地址
2、接口支持https
{
"code": 200,
"status": "success",
"message": "",
"data": "rtmp://push-c1.videocc.net/recordf/streamname"
}
{
"code": 400,
"status": "error",
"message": "param validate error",
"data": 400
}
{
"code": 400,
"status": "error",
"message": "appId is required.",
"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": ""
}
public static void test() {
String url = "https://api.polyv.net/live/v3/channel/stream/get-push-url";
// 用户对应的appId和加密串
String appId = "xxxxxxxxx";
String appSecret = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
Map<String, String> params = new HashMap<>();
params.put("channelId", 100001);
PolyvTool.setLiveSign(params, appId, appSecret);
// 调用Polyv的httpClient工具类发送请求
HttpClientUtil.getInstance()
.sendHttpGet(url + "?" + PolyvTool.mapJoinNotEncode(params));
System.out.println(content);
}