文档

GetLive - 查询直播详情

更新时间:

查询与指定直播相关联的信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用加粗字体表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
imp:GetLiveRead
  • IMP
    acs:imp::{#accountId}:*

请求参数

名称类型必填描述示例值
LiveIdstring

直播资源的唯一标识ID。

b7f2****ebb3

返回参数

名称类型描述示例值
object

Schema of Response

RequestIdstring

请求ID。

FE22D613-D3C6-4A58-87CA-F21FC85AA08E
Resultobject

查询直播详情的返回结果。

AnchorIdstring

主播ID。

as****hs
LiveIdstring

直播资源的唯一标识ID。

b7f2****ebb3
Titlestring

直播标题。

This is a title.
PlaybackUrlstring

直播回放地址。直播开始时生成,直播结束后可以观看。

http://demo-app-playback.com/live/b7f2****ebb3.m3u8?auth_key=e620****a8e3
CreateTimeLong

直播创建时间,单位:毫秒。直播开始后生成。

1624259500000
EndTimeLong

直播结束时间,单位:毫秒。直播结束后生成。

1624259500000
DurationLong

直播持续时间,单位:毫秒。直播结束后生成。

10000
PushUrlstring

直播推流地址。

rtmp://demo-app-push.com/live/e620****a8e3?auth_key=e620****a8e3
LiveUrlstring

直播拉流地址。

http://demo-app-live.com/live/e620****a8e3.flv?auth_key=e620****a8e3
Statusstring

直播状态。取值:

  • Created:已创建,未开始直播。
  • Living:直播中。
  • End:直播结束。
Created
Introductionstring

直播简介。

This is an introduction.
RoomIdstring

房间ID。

AE35-****-T95F
AppIdstring

租户名。

7m***q
UserIdstring

创建直播用户。

as****hs
CodeLevelinteger

直播推流码率。取值:

  • -1:流畅,分辨率:宽度自适应,高度:360;编码格式:H.264。
  • 1:标清,分辨率:宽度自适应,高度:432;编码格式:H.264。
  • 2:高清,分辨率:宽度自适应,高度:648;编码格式:H.264。
  • 3:超清,分辨率:宽度自适应,高度:1080;编码格式:H.264。
1
PlayUrlInfoListarray

多分辨率多协议播放信息。

object
CodeLevelinteger

直播推流码率。取值:

  • -1:流畅,分辨率:宽度自适应,高度:360;编码格式:H.264。
  • 1:标清,分辨率:宽度自适应,高度:432;编码格式:H.264。
  • 2:高清,分辨率:宽度自适应,高度:648;编码格式:H.264。
  • 3:超清,分辨率:宽度自适应,高度:1080;编码格式:H.264。
1
FlvUrlstring

FLV拉流地址。

http://demo-app-live.com/live/b7f2****ebb3.flv?auth_key=e620****a8e3
HlsUrlstring

HLS拉流地址。

http://demo-app-live.com/live/b7f2****ebb3.m3u8?auth_key=e620****a8e3
RtmpUrlstring

RTMP拉流地址。

rtmp://demo-app-live.com/live/b7f2****ebb3?auth_key=e620****a8e3
CoverUrlstring

封面图片。

http://demo-app-live.com/live/b7f29c02-****-40fd-****-e8d06a8aebb3.png
UserDefineFieldstring

用户自定义数据存储。

{"selfData":"example"}
HlsUrlstring

原画HLS播放地址。

http://demo-app-live.com/live/b7f29c02-****-40fd-****-e8d06a8aebb3.m3u8?auth_key=1627522726-0-0-******e620b363d4cf8a8e3
ArtcInfoobject

RTS低延迟播流信息。

ArtcUrlstring

RTS原码流地址,推荐移动端使用。

artc://demo-app-live.com/live/b7f29c02-****-40fd-****-e8d06a8aebb3?auth_key=1627522726-0-0-******e620b363d4cf8a8e3
ArtcH5Urlstring

RTS转码流地址,推荐web端使用。

artc://demo-app-live.com/live/b7f29c02-****-40fd-****-e8d06a8aebb3_origin-RTS?auth_key=1627522726-0-0-******e620b363d4cf8a8e3

示例

请求示例

http(s)://[Endpoint]/?Action=GetLive
&LiveId=b7f2****ebb3
&公共请求参数

正常返回示例

JSON格式

{
    "RequestId": "FE22D613-D3C6-4A58-87CA-F21FC85AA08E",
    "Result": {
        "AnchorId": "as****hs",
        "LiveId": "b7f2****ebb3",
        "Title": "This is a title.",
        "PlaybackUrl": "http://demo-app-playback.com/live/b7f2****ebb3.m3u8?auth_key=e620****a8e3",
        "CreateTime": 1624259500000,
        "EndTime": 1624259500000,
        "Duration": 10000,
        "PushUrl": "rtmp://demo-app-push.com/live/e620****a8e3?auth_key=e620****a8e3",
        "LiveUrl": "http://demo-app-live.com/live/e620****a8e3.flv?auth_key=e620****a8e3",
        "Status": "Created",
        "Introduction": "This is an introduction.",
        "RoomId": "AE35-****-T95F",
        "AppId": "7m***q",
        "UserId": "as****hs",
        "CodeLevel": 1,
        "PlayUrlInfoList": {
            "CodeLevel": 1,
            "FlvUrl": "http://demo-app-live.com/live/b7f2****ebb3.flv?auth_key=e620****a8e3",
            "HlsUrl": "http://demo-app-live.com/live/b7f2****ebb3.m3u8?auth_key=e620****a8e3",
            "RtmpUrl": "rtmp://demo-app-live.com/live/b7f2****ebb3?auth_key=e620****a8e3"
        }
    }
}

XML格式

<GetLiveResponse>
    <RequestId>FE22D613-D3C6-4A58-87CA-F21FC85AA08E</RequestId>
    <Result>
        <AnchorId>as****hs</AnchorId>
        <LiveId>b7f2****ebb3</LiveId>
        <Title>This is a title.</Title>
        <PlaybackUrl>http://demo-app-playback.com/live/b7f2****ebb3.m3u8?auth_key=e620****a8e3</PlaybackUrl>
        <CreateTime>1624259500000</CreateTime>
        <EndTime>1624259500000</EndTime>
        <Duration>10000</Duration>
        <PushUrl>rtmp://demo-app-push.com/live/e620****a8e3?auth_key=e620****a8e3</PushUrl>
        <LiveUrl>http://demo-app-live.com/live/e620****a8e3.flv?auth_key=e620****a8e3</LiveUrl>
        <Status>Created</Status>
        <Introduction>This is an introduction.</Introduction>
        <RoomId>AE35-****-T95F</RoomId>
        <AppId>7m***q</AppId>
        <UserId>as****hs</UserId>
        <CodeLevel>1</CodeLevel>
        <PlayUrlInfoList>
            <CodeLevel>1</CodeLevel>
            <FlvUrl>http://demo-app-live.com/live/b7f2****ebb3.flv?auth_key=e620****a8e3</FlvUrl>
            <HlsUrl>http://demo-app-live.com/live/b7f2****ebb3.m3u8?auth_key=e620****a8e3</HlsUrl>
            <RtmpUrl>rtmp://demo-app-live.com/live/b7f2****ebb3?auth_key=e620****a8e3</RtmpUrl>
        </PlayUrlInfoList>
    </Result>
    </GetLiveResponse>

错误码

访问错误中心查看更多错误码。

  • 本页导读 (1)
文档反馈