查询观看页默认模板设置
接口描述
1、查询观看页默认模板设置
2、接口支持https协议
接口URL
http://api.polyv.net/live/v4/user/template/page-setting/get
请求方式
GET
接口约束
1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看
请求参数描述
示例
http://api.polyv.net/live/v4/user/template/page-setting/get?appId=frlr1zazn3&sign=AE85C401707A2E1DB3376A56E1C17B71×tamp=1686883677414
响应参数描述
Data参数描述
autoPlayEnabled
String
自动播放开关,Y:开启,N:关闭
barrageEnabled
String
弹幕开关,Y:开启,N:关闭
barrageSpeed
String
弹幕速度,340:缓慢,270:较慢,200:标准,130:较快,60:快速
bookingEnabled
String
微信预约功能开关,Y:开启,N:关闭
closePreviewEnabled
String
观看页开关,Y:不显示观看页(仅允许集成SDK观看),N:显示观看页
flashPlayerEnabled
String
flash播放器开关,Y:开启,N:关闭
forbidFirefoxEnabled
String
禁止Firefox开关,Y:开启,N:关闭
mobileAudioEnabled
String
音视频切换开关,Y:开启,N:关闭
mobilePvShowLocation
String
观看次数移动端显示位置,player:播放器,desc:直播介绍
mobileWatchEnabled
String
移动观看页开关,Y:开启,N:关闭
pvShowEnabled
String
观看次数开关,Y:开启,N:关闭
recordingProtectEnabled
String
防弹窗播放开关,Y:开启,N:关闭
showCountdownEnabled
String
回放中显示“下一场次”倒计时 开关值,Y:开启,N:关闭
switchPlayerEnabled
String
允许观众切换h5及flash播放器,Y:允许,N:不允许;flash播放器开关为N时,该值不生效
viewerVerificationEnabled
String
观众实名认证开关,Y:开启,N:关闭
watchFeedbackEnabled
String
观众投诉开关,Y:开启,N:关闭
watchLangType
String
观看页语言,zh_CN:中文,en:英文,follow_browser:跟随浏览器
watchLayout
String
观看页布局,ppt文档为主、video视频为主、only-video仅视频、followTeacher跟随讲师
pictureInPictureEnabled
String
小窗播放开关,Y:开启,N:关闭
Error参数描述
code
Integer
错误代码,用于确定具体的错误原因
desc
String
错误描述,与 error.code 对应
Java请求示例
快速接入基础代码请下载相关依赖源码, 点击下载源代码 ,下载后加入到自己的源码工程中即可。测试用例中的HttpUtil.java 和 LiveSignUtil.java 都包含在下载文件中。
强烈建议您使用直播Java SDK完成API的功能对接,直播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(getClass());
/**
* 查询观看页默认模板设置
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void pageSettingGetTest() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/live/v4/user/template/page-setting/get";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.info("测试查询观看页默认模板设置成功:{}", response);
//do somethings
}
响应示例
系统全局错误说明详见全局错误说明
成功示例
{
"code": 200,
"status": "success",
"requestId": "c6960468a2ab4e49bf2fc560248267a3.4372.16868836964021307",
"data": {
"closePreviewEnabled": "Y",
"watchLayout": "followTeacher",
"watchLangType": "follow_browser",
"mobileWatchEnabled": "Y",
"mobileAudioEnabled": "Y",
"bookingEnabled": "N",
"recordingProtectEnabled": "N",
"forbidFirefoxEnabled": "N",
"flashPlayerEnabled": "N",
"switchPlayerEnabled": "Y",
"barrageEnabled": "Y",
"barrageSpeed": "60",
"autoPlayEnabled": "N",
"watchFeedbackEnabled": "Y",
"showCountdownEnabled": "Y",
"pvShowEnabled": "Y",
"mobilePvShowLocation": "player",
"viewerVerificationEnabled": "N"
},
"success": true
}
异常示例
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
Last updated
Was this helpful?