ydlive接口说明 - zhouted/zhouted.github.io GitHub Wiki

频道实体类(class Channel)属性:

Integer id //频道id
String name //频道名称
String passwd //频道密码
String publisher//主持人
String status //直播流状态
String stream //直播流
String url //推流地址
String m3u8Url //播放地址

频道meta类(class ChannelMeta)属性:

//下列用来传入参数:
Integer id//频道id
String name//频道名称
String passwd//频道密码
String publisher//主持人
Integer maxViewer//最大在线人数
Boolean enablePlayback//开启回放
Boolean withStatus//带上直播流状态
//下列用来返回操作状态:
Integer resCode //http返回码
Object resData //返回数据
String resStatus//http返回状态
String resMessage//返回消息
boolean isOK() //是否操作成功

频道管理类(class ChannelManager)方法:

  1. 设置获取所有频道列表
@param none
@return List<Channel> 仅包含id&name&passwd
public static List<Channel> getChannelList()
  1. 创建直播频道
@param String name	频道名称为空随机生成
@param String passwd	频道密码为空随机生成
@param Boolean playback	频道回放开关为空关闭
@param String publisher	主持人姓名
@param Integer maxViewer最大在线人数
@return Channel
public static Channel createChannel() {
public static Channel createChannel(String name, String passwd) {
public static Channel createChannel(String name, String passwd, Boolean playback, String publisher, Integer maxViewer)
  1. 更新频道信息
@param int channelId	频道id下列参数为空不设置
@param String name	频道名称
@param String passwd	频道密码
@param Boolean playback	频道回放开关
@param String publisher	主持人姓名
@param Integer maxViewer最大在线人数
@return ChannelMeta 操作结果 
public static ChannelMeta updateChannel(int channelId, String name, String passwd, Boolean playback, String publisher, Integer maxViewer)
  1. 获取频道信息
@param int channelId
@param  Boolean withStatus
@return Channel
public static Channel getChannel(int channelId)
public static Channel getChannel(int channelId, Boolean withStatus)
  1. 删除频道
@param int channelId
@return ChannelMeta 操作结果 
public static ChannelMeta deleteChannel(int channelId)
  • 以上方法的参数均可改为使用new ChannelMeta()传入。这样,方法执行结果会放到ChannelMeta.resXXX字段里返回。
⚠️ **GitHub.com Fallback** ⚠️