@sewise-dev
2017-07-13T03:54:41.000000Z
字数 2214
阅读 567
微录播
导播
星云
编号 | 说明 | 作者 | 日期 |
---|---|---|---|
1 | 第一版 | huanghy | 2017/6/7 17:00 |
2 | 文件请求路径和参数皆有修改(可选择是否对接星云) | huanghy | 2017/6/8 14:30 |
接口地址
/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"}
接口地址
/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 camera_json 否 json 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"}
接口地址
/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"}
接口功能
直播流异常时,星云调用此接口,将会关闭此直播
接口地址
/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"}