Channel Old
描述
创建一个直播频道,返回直播频道相关的基础信息。
接口地址(仅做说明使用):https://api.polyv.net/live/v2/channels/调用约束
单元测试
@Test
public void testCreateChannel() throws Exception, NoSuchAlgorithmException {
LiveChannelRequest liveChannelRequest = new LiveChannelRequest();
LiveChannelResponse liveChannelResponse = null;
try {
liveChannelRequest.setName("Spring 知识精讲").setChannelPasswd("666888");
// .setAutoPlay(LiveConstant.AutoPlay.AOTU_PLAY.getFlag())
// .setScene(LiveConstant.SceneType.PPT.getDesc())
// .setMaxViewer(300)
// .setWatchLayout(LiveConstant.WatchLayout.PPT.getFlag())
// .setLinkMicLimit(2)
// .setPureRtcEnabled(LiveConstant.Flag.YES.getFlag())
// .setReceive(LiveConstant.Flag.YES.getFlag())
liveChannelResponse = new LiveChannelOperateServiceImpl().createChannel(liveChannelRequest);
Assert.assertNotNull(liveChannelResponse);
if (liveChannelResponse != null) {
//to do something ......
log.debug("频道创建成功{}", JSON.toJSONString(liveChannelResponse));
log.debug("网页开播地址:https://live.polyv.net/web-start/login?channelId={} , 登录密码: {}",
liveChannelResponse.getChannelId(), liveChannelRequest.getChannelPasswd());
log.debug("网页观看地址:https://live.polyv.cn/watch/{} ", liveChannelResponse.getChannelId());
}
} catch (PloyvSdkException e) {
//参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage(),B
log.error(e.getMessage(), e);
// 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
throw e;
} catch (Exception e) {
log.error("SDK调用异常", e);
throw e;
}
}
}单元测试说明
请求入参描述
参数名
必选
类型
说明
返回对象描述
参数名
类型
说明
Last updated