直播云

  • 批量查询直播实时信息

    最近更新时间:2017-06-16 15:56:18

    • 批量查询直播的开始时间、主播IP、当前码率、当前帧率等信息

    规格

    请求包:

    POST /v2/hubs/<Hub>/livestreams
    Host: pili.qiniuapi.com
    Authorization: <QiniuToken>
    Content-Type: application/json
    {
        "items": ["<StreamTitle1>", "<StreamTitle2>", ...]
    }
    
    参数名称 必填 说明
    Hub 直播空间名
    items 要查询的流名字符串数组,最大长度为100

    返回包:

    200 {
        "items": [
            {
                "key": "<StreamTitle>",
                "startAt": <StartAt>,
                "clientIP": "<ClientIP>",
                "bps": <Bps>, // 当前码率
                "fps": {
                    "audio": <Audio>,
                    "video": <Video>,
                    "data": <Data>
            },
            ...
        ]
    
    }
    
    • 查询的流不存在或不在直播不会出现在返回结果里
    • key: 字符串,StreamTitle 流名,其余字段可参考

    示例

    请求包:

    POST /v2/hubs/PiliSDKTest/livestreams HTTP/1.1
    Host: 10.200.20.28:7778
    User-Agent: pili-sdk-go/v2 go1.7.1 darwin/amd64
    Content-Length: 27
    Authorization: Qiniu Ge_kRfuV_4JW0hOCOnRq5_kD1sX53bKVht8FNdd3:mlqfa6kfo9h03YeM3faNlY0gLqo=
    Content-Type: application/json
    Accept-Encoding: gzip
    
    {"items":["test1","test2"]}
    

    返回包:

    HTTP/1.1 200 OK
    Content-Length: 132
    Content-Type: application/json
    Date: Tue, 28 Feb 2017 06:55:34 GMT
    X-Log: s.exp:1490447038;PILI:4;PILI-LINA:6
    X-Reqid: HBTICg0g5h61WFgA
    
    {"items":[{"startAt":1488264615,"clientIP":"172.21.2.14:57504","bps":1179120,"fps":{"audio":46,"video":25,"data":0},"key":"test1"}]}
    
    以上内容是否对您有帮助?
  • Icon free helper
    Close