4.直播流相关接口
4.1.查询活动的视频流
-
用途
查询活动的视频流,即正在直播中的视频流。
-
请求
streamMgr/?request=get_active_streams
- 响应
{
"code":0,
"data":{
"count":1,
"items":[
{
"server":"g3",
"host":"192.168.1.230",
"protocol":"rtmp",
"app":"live",
"stream":"live2",
"uid":"23000043",
"end":"end",
"starttime":1516242339
}
]
}
}
items数组可能包含0或多个元素。
server 服务器类型,默认是g3
host 服务器IP地址或域名
protocol 直播协议,rtmp或rtsp
app 应用名
stream 流名称
starttime 开始直播的时间,是一个unix时间戳
4.2.关闭并禁用直播流
4.3.解除禁用的直播流
4.4.查询被禁用的直播流
{
"code":0,
"data":{
"count":1,
"items":[
{
"application":"liveshow",
"stream":"live1",
"time":1516274119
}
]
}
}
items元素下包含被禁用的直播流列表。
application 应用名
stream 直播流名称
time 禁用时间,unix时间戳
4.5.关闭直播流(不禁用)
- 用途
关闭一个直播流,但是不禁用,推流客户端可以再次推流进来。
调用该接口后,直播流会被立即关闭,直播客户端和播放客户端的连接都会中断。
- 请求
streamMgr/?request=close_active_stream&application=live&stream=live2
application 应用名
stream 直播流名称
响应
{
"code":0
}