Get Resources of Video Clips

Last Updated on : 2023-06-20 14:53:44download

Get the resources of video clips that are stored in the cloud within the specified time range.

API address

GET: /v1.0/users/{uid}/devices/{device_id}/storage/stream/hls

Request parameter

Parameter nameTypeINRequiredDescription
uidStringuritrueThe user ID.
device_idStringuritrueThe device ID.
time_g_tLongquerytrueThe start time.
time_l_tLongquerytrueThe end time.
callbackStringquerytrueThe HTTP callback address. To get the decryption key of video clips stored in the cloud, the callback service needs to call the HTTP API: {callback}/api/cloud/key?devId={deviceId}&magic={magic}.

Return parameter

Parameter nameTypeDescription
resultStorageHLSVOThe returned result.

Description of result

Parameter nameTypeDescription
listListThe list of video clips.

Description of list

Parameter nameTypeDescription
urlStringThe HLS playback URL of a specified video file.
start_timeLongThe start time of a specified video clip. The 10-digit timestamp is in seconds.
stop_timeLongThe end time of a specified video clip. The 10-digit timestamp is in seconds.

Request example

GET: /v1.0/users/ay156402688****oY5W/devices/6c08578d894****11afye1/storage/stream/hls?time_g_t=1637639832&time_l_t=1637675832&callback=http://localhost:3333

Return example

{
    "result": {
        "list": [
            {
                "stop_time": 1638177232,
                "url": "https://****.tuyacn.com:****/cloudrecord/6c08578d894****11afye1/c6i9jnhv5aoq5nqq0hjgStT86FTi****.m3u8",
                "start_time": 1638177212
            }
        ]
    },
    "t": 1638177247793,
    "success": true
}

Error code

For more information, see error code.

Sample integration of videos in the cloud

Get Resources of Video Clips