[关闭]
@sewise-dev 2017-07-13T03:54:41.000000Z 字数 2214 阅读 567

导播接口文档(对接星云)

微录播 导播 星云


更新历史

编号 说明 作者 日期
1 第一版 huanghy 2017/6/7 17:00
2 文件请求路径和参数皆有修改(可选择是否对接星云) huanghy 2017/6/8 14:30

1.创建导播间

接口地址

/direct

HTTP Content-Type / 请求方式

application/json
POST

请求参数

方式1(对接星云)

参数 必选 类型 说明
RequestBody
get_peerstar int 是否对接星云标识(0:表示不对接,1:表示对接)
appid string 所属应用id
live_url string 直播源地址
cdn_url string cdn加速地址
title string 名称
start_time string 开始时间
phone_id string 手机唯一id

方式2(不对接星云)

参数 必选 类型 说明
RequestBody
get_peerstar int 是否对接星云标识(0:表示不对接,1:表示对接)
live_url string 直播源地址
title string 名称
start_time string 开始时间
phone_id string 手机唯一id

HTTP返回结果

返回字段 类型 说明
success boolean 返回结果:true/false
direct_id string 导播id
channel_id string 创建的频道id(对接星云时才返回此数据)

接口示例

Request
url: http://ip:port/direct
Response
成功:{"success":true,"direct_id":"xxx","channel_id":"xxx"}
失败:{"success":false,"error":"xxx"}

2.修改导播信息

接口地址

/direct/:direct_id

HTTP Content-Type / 请求方式

application/json
PUT

请求参数

参数 必选 类型 说明
PathParam
direct_id string 导播id
RequestBody
status int 直播状态(0:关闭,2:开启)
channel_id string 频道id(对接星云时,要改变直播状态(status),此参数必需)
title string 名称
introduction string 课程简介
poster string 海报
pdf_json json pdf
camera_json json pdf
start_time string 开始时间
people_num int 房间人数
phone_id string 手机唯一id
mouseX string
mouseY string

HTTP返回结果

返回字段 类型 说明
success boolean 返回结果:true/false

接口示例

例如:已知direct_id为619dcf49-5a42-4a2f-af48-6e63ab67a0b3,channel_id为59378e5b4fc8d25e766f4483
Request
url: http://ip:port/direct/619dcf49-5a42-4a2f-af48-6e63ab67a0b3/59378e5b4fc8d25e766f4483
Response
成功:{"success":true}
失败:{"success":false,"error":"xxx"}

3.结束导播

接口地址

/direct/:direct_id

HTTP Content-Type / 请求方式

application/json
DELETE

请求参数

参数 必选 类型 说明
PathParam
direct_id string 导播id
RequestBody
channel_id string 频道id(对接星云时,此参数必需)

HTTP返回结果

返回字段 类型 说明
success boolean 返回结果:true/false

接口示例

例如:已知direct_id为619dcf49-5a42-4a2f-af48-6e63ab67a0b3,channel_id为59378e5b4fc8d25e766f4483
Request
url: http://ip:port/direct/619dcf49-5a42-4a2f-af48-6e63ab67a0b3/59378e5b4fc8d25e766f4483
Response
成功:{"success":true}
失败:{"success":false,"error":"xxx"}

4.星云通知异常状态

接口功能

直播流异常时,星云调用此接口,将会关闭此直播

接口地址

/direct/stop/:direct_id

HTTP Content-Type / 请求方式

application/json
post

请求参数

参数 必选 类型 说明
PathParam
direct_id string 导播id

HTTP返回结果

返回字段 类型 说明
success boolean 返回结果:true/false

接口示例

例如:已知direct_id为619dcf49-5a42-4a2f-af48-6e63ab67a0b3
Request
url: http://ip:port/direct/stop/619dcf49-5a42-4a2f-af48-6e63ab67a0b3
Response
成功:{"success":true}
失败:{"success":false,"error":"xxx"}

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注