Get Live Streaming Address

Last Updated on : 2023-06-15 05:19:07

Get the live streaming address by device ID and the video type. The available live streaming video protocols include RTSP and HLS.

API address

POST: /v1.0/devices/{device_id}/stream/actions/allocate

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueThe device ID.

Description of body

Parameter nameTypeINRequiredDescription
typeStringbodytrueThe available live streaming video protocols. Valid values: RTSP and HLS.

Return parameter

Parameter nameTypeDescription
resultStreamVOThe returned result.

Description of result

Parameter nameTypeDescription
urlStringThe address of live streaming.

Request example

POST: /v1.0/users/ay156402688****voY5W/devices/6c08578d894****11afye1/stream/actions/allocate
{
  "type": "hls"
}

Return example

{
    "result": {
        "url": "https://wework1.****.com:554/hls/6c08578d89****411afye1/c146ioh525qd7j2l1590315x7E7xNu6PW3kXSfQL.m3u8?signInfo=PnwWBVmaoNSubTJ7Fb1cjsJNXZeuXn%2F2k2FFwNS6EuYlD5f3UtciKvNxIyYUHsKvODeI6nmDP3y51sWbXVfqbFu6q9PDNDG005cRkSWnfzA%2BxYuq1JMeJoJvWb8uJd5YNtMlbGcsQ81knGoMXCDtJC9fyY%2FPkEyXQyGntlHzVd0%3D"
    },
    "t": 1615358306701,
    "success": true
}

Error code

For more information, see error code.