You need to enable JavaScript to run this app.
最新活动
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们
导航

获取直播流信息

最近更新时间2023.02.24 10:02:40

首次发布时间2022.03.29 22:10:12

获取当前直播间的推流地址信息。

请求说明

  • 接口名称:GetStreamsAPI
  • 请求方式:GET
  • 接口地址:http://livesaas.volcengineapi.com/?Action=GetStreamsAPI&Version=2020-06-01
  • 请求频率:单用户请求频率限制为 120 次/分钟

请求参数

以下请求参数列表仅列出了该接口的部分公共参数,完整公共参数列表见公共请求参数

Query

参数类型是否必选描述
ActionString接口名称
VersionString接口版本。直播当前 API 的版本为 2020-06-01
ActivityIdInt64直播间 ID

返回参数

参数类型描述
LineDetailsArray of LineDetails直播流信息

LineDetails

参数类型描述
LineIdInt64直播流 ID
LineNameString直播流名称
MainPushInfoArray of PushInfo直播流主流的推流地址
BackPushInfoArray of PushInfo直播流备流的推流地址
RatioString直播流的分辨率
ForwardInfoArray of ForwardInfo直播流主流的拉流转推信息
BackupForwardInfoArray of ForwardInfo直播流备流的拉流转推信息
ExpireTimeInt64推流码的过期时间

PushInfo

参数类型描述
PushPathString推流服务器 URL
PushUrlString推流完整 URL
StreamingCodeString推流串流秘钥

ForwardInfo

参数类型描述
PullStreamUrlString拉流直播的拉流 URL

PullStreamStatus

String

拉流直播的任务状态。支持以下取值

  • 0:拉流任务初始化中
  • 1:拉流任务运行中
  • 2:拉流任务已结束

PullStreamCheckStatus

String

直播流主流的推流地址。支持以下取值

  • 0:检测中
  • 1:源流未推流
  • 2:正常拉流
  • 3:拉流结束
  • 4:拉流异常

示例

请求示例

Get http://livesaas.volcengineapi.com/?Action=GetStreamsAPI&Version=2020-06-01&ActivityId=1231231231

正常返回示例

{
		"ResponseMetadata":{
				"RequestId":"202201201826170101501312091D1C09D2",
				"Action":"GetStreamsAPI",
				"Version":"2020-06-01",
				"Service":"livesaas",
				"Region":"cn-north-1",
				"SystemTime":1656067132
		},
		"Result":{
				"LineDetails":[
						{
								"LineId":123,
								"LineName":"线路1",
								"MainPushInfo":{
										"PushPath":"https://example-livesaas.com/example",
										"StreamingCode":"livesaas?key=example",
										"PushUrl":"https://example-livesaas.com"			
								},
								"BackPushInfo":{
										"PushPath":"https://example-livesaas.com/example",
										"StreamingCode":"livesaas?key=example",
										"PushUrl":"https://example-livesaas.com/livesaas?key=example"	
								},
								"Ratio": "1920*1080",
								"ForwardInfo":{
										"PullStreamUrl":"https://example/livesaas?key=example",
										"PullStreamStatus":1,
										"PullStreamCheckStatus":1																
								},
								"BackupForwardInfo":{
										"PullStreamUrl":"https://example/livesaas?key=example",
										"PullStreamStatus":1,
										"PullStreamCheckStatus":1																
								},
								"ExpireTime":1643004493				
						}
				]    
		}
}

异常返回示例

{
		"ResponseMetadata":{
				"RequestId":"201806041104200100100232280022D30",
				"Action":"GetStreamsAPI",
				"Version":"2020-06-01",	
				"Service":"livesaas",
				"Region":"cn-north-1",
				"SystemTime":1656067132,
				"Error":{
						"Code":"200000",
						"Message":"参数异常"
				}
		}
}

错误码

访问公共错误码获取详细信息。