ApiAppKey
and ApiAppSecret
) is used for authentication. For more information, see Application-Enabled Authentication.Parameter | Type | Required | Description |
Action | string | Yes | Requested operation type. To start recording, set it to Start . |
Data | object | Yes | Request protocol parameter. |
RecordURL | string | Yes | Access URL of the webpage to be recorded. It must be accessible in Chrome. |
ManualStart | bool | Yes | Whether the recording task to be created can start after the page actively calls the window.startRecord method to trigger recording. The default value is false , indicating that the recording task will start automatically. If the value is set to true , after the recording function loads the page, it will not automatically start recording but will trigger recording after the page actively calls the window.startRecord method. |
Width | number | No | Recording image width, which is 1280 by default. Value range: 0–2560. |
Height | number | No | Recording image height, which is 720 by default. Value range: 0–2560. |
CallbackURL | string | No | Callback address for recording result notification |
MaxDurationLimit | int | No | Maximum recording duration in seconds. Value range: 0–36000s. Default value: 21600s (6 hours). You need to configure a permanent key if this value exceeds 6 hours. |
StorageType | string | No | Storage position of the intermediate state webm file during recording. Valid values: cos and cfs . Default value: cfs . (If the COS_BUCKET_RAW parameter is configured in the environment variables, data will be written into the bucket; otherwise, data will be written to the raw path in the target bucket.) |
Output | object | No | Request protocol parameter. |
Cos | object | No | Request protocol parameter. |
Domain | string | No | Recording file playback domain name. If it is not set, it will be the origin server domain name by default. |
Bucket | string | No | Recording file storage bucket. If it is not set, it will be the storage bucket set during function creation by default. |
Region | string | No | Recording file storage region. If it is not set, it will be the region of the storage bucket by default. |
TargetDir | string | No | Recording file storage path. If it is not set, it will be Taskid by default. |
TargetName | string | No | Recording filename. If it is not set, it will be the stop timestamp by default. |
Vod | object | No | VOD configuration parameter. |
MediaInfo | object | No | VOD media asset information. |
MediaName | string | No | Media asset name. |
ExpireTime | Timestamp ISO8601 | No | |
StorageRegion | string | No | Upload region. This is only applicable to users who have special requirements for the upload region. |
ClassId | Integer | No | Category ID, which is used to categorize the media asset for management. A category can be created and its ID can be obtained by using the CreateClass API. |
SourceContext | string | No | Source context of up to 250 characters, which is used to pass through the user request information and will be returned by the VOD upload completion callback. |
ProcedureInfo | object | No | Task flow information |
Procedure | string | No | Subsequent task operation on a media asset file, i.e., after a media asset file is uploaded, task flow operations will be initiated automatically. This parameter value is a task flow template name. VOD supports creating templates and naming them. |
SessionContext | string | No | Session context of up to 1,000 characters, which is used to pass through the user request information. If the procedure parameter is specified, the task flow status change callback API will return the value of this field. |
SubAppId | string | No | ID of a subapplication in VOD. If you need to access a resource in a subapplication, enter the subapplication ID in this field; otherwise, leave it empty. |
Video | object | No | Request protocol parameter. |
Muxer | string | No | Recording file format. Valid values: hls and mp4 . If it is not set, it will be mp4 by default. |
EncryptKey | string | No | HLS encryption public key. If it is not set, no encryption will be performed by default. |
AuthUrl | string | No | Decryption private key address, which is required if the public key is set. |
{"Action": "Start","Data": {"RecordURL": "https://web-record-12596******.cos.ap-chengdu.myqcloud.com/test/ponyo.mp4","Width": 1280,"Height": 720,"CallbackURL": "http://xxx/webrecord/callback","MaxDurationLimit": 21600,"Output":{"Cos":{"Domain":"abc.xxx.com","Bucket":"webrecord-xxx","Region":"ap-shanghai","TargetDir":"11234/","TargetName":"record-file-name.mp4"},"Vod": {"MediaInfo": {"MediaName": "test","ExpireTime": "2023-10-01T10:00:00Z","StorageRegion": "ap-shanghai","ClassId": 1},"ProcedureInfo": {"Procedure": "","SessionContext": ""},"SubAppId": 1500007120},"Video": {"Muxer": "hls","EncryptKey": "21834cca41778803e1afba3f41e70c90","AuthUrl": "https://hls-web-record-1253970226.cos.ap-shanghai.myqcloud.com/m3u8-encrypt/enc.key"}}}}
Parameter | Type | Required | Description |
ErrorCode | string | No | Error code, which will be returned only when a request error occurs. |
ErrorMessage | string | No | Error message, which will be returned only when a request error occurs. |
TaskID | string | No | Recording task ID, which will be returned only when recording successfully starts. |
RequestID | string | No | Request ID. |
// Response upon request success{"TaskID": "d1806f20-25b8-4c30-8176-c0832b******","RequestID": "95941e2c85898384a95b81c2a5******"}// Response upon request failure{"ErrorCode": "InvalidParam","ErrorMessage": "RecordURL missing","RequestID": "95941e2c85898384a95b81c2a5******"}
Parameter | Type | Required | Description |
Action | string | Yes | Requested operation type. To pause recording, set it to Pause . |
Data | object | Yes | Request protocol parameter. |
Data.TaskID | string | Yes | ID of the recording task to be paused, which can be obtained in the response parameters of the recording start API. |
{"Action": "Pause","Data": {"TaskID": "0f7d9522-a1a3-4517-b5ad-7a6eca******"}}
Parameter | Type | Required | Description |
ErrorCode | string | No | Error code, which will be returned only when a request error occurs. |
ErrorMessage | string | No | Error message, which will be returned only when a request error occurs. |
TaskID | string | No | Recording task ID, which will be returned only when recording successfully starts. |
RequestID | string | No | Request ID. |
// Response\\supon\\srequest\\ssuccess{"TaskID": "d1806f20-25b8-4c30-8176-c0832b******","RequestID": "95941e2c85898384a95b81c2a5******"}// Response upon request failure{"ErrorCode": "InvalidParam","ErrorMessage": "TaskID missing","RequestID": "95941e2c85898384a95b81c2a5******"}
Parameter | Type | Required | Description |
Action | string | Yes | Requested operation type. To resume recording, set it to Resume . |
Data | object | Yes | Request protocol parameter. |
Data.TaskID | string | Yes | ID of the recording task to be resumed, which can be obtained in the response parameters of the recording start API. |
{"Action": "Resume","Data": {"TaskID": "0f7d9522-a1a3-4517-b5ad-7a6eca******"}}
Parameter | Type | Required | Description |
ErrorCode | string | No | Error code, which will be returned only when a request error occurs. |
ErrorMessage | string | No | Error message, which will be returned only when a request error occurs. |
TaskID | string | No | Recording task ID, which will be returned only when recording successfully starts. |
RequestID | string | No | Request ID. |
// Response upon request success{"TaskID": "d1806f20-25b8-4c30-8176-c0832b******","RequestID": "95941e2c85898384a95b81c2a5******"}// Response upon request failure{"ErrorCode": "InvalidParam","ErrorMessage": "TaskID missing","RequestID": "95941e2c85898384a95b81c2a5******"}
Parameter | Type | Required | Description |
Action | string | Yes | Requested operation type. To refresh recording, set it to Refresh . |
Data | object | Yes | Request protocol parameter. |
Data.TaskID | string | Yes | ID of the recording task to be refreshed, which can be obtained in the response parameters of the recording start API. |
{"Action": "Refresh","Data": {"TaskID": "0f7d9522-a1a3-4517-b5ad-7a6eca******"}}
Parameter | Type | Required | Description |
ErrorCode | string | No | Error code, which will be returned only when a request error occurs. |
ErrorMessage | string | No | Error message, which will be returned only when a request error occurs. |
TaskID | string | No | Recording task ID, which will be returned only when recording successfully starts. |
RequestID | string | No | Request ID. |
// Response upon request success{"TaskID": "d1806f20-25b8-4c30-8176-c0832b******","RequestID": "95941e2c85898384a95b81c2a5******"}// Response upon request failure{"ErrorCode": "InvalidParam","ErrorMessage": "TaskID missing","RequestID": "95941e2c85898384a95b81c2a5******"}
Parameter | Type | Required | Description |
Action | string | Yes | Requested operation type. To stop recording, set it to Stop . |
Data | object | Yes | Request protocol parameter. |
Data.TaskID | string | Yes | ID of the recording task to be stopped, which can be obtained in the response parameters of the recording start API. |
{"Action": "Stop","Data": {"TaskID": "0f7d9522-a1a3-4517-b5ad-7a6eca******"}}
Parameter | Type | Required | Description |
ErrorCode | string | No | Error code, which will be returned only when a request error occurs. |
ErrorMessage | string | No | Error message, which will be returned only when a request error occurs. |
TaskID | string | No | Recording task ID, which will be returned only when recording successfully starts. |
RequestID | string | No | Request ID. |
// Response upon request success{"TaskID": "d1806f20-25b8-4c30-8176-c0832b******","RequestID": "95941e2c85898384a95b81c2a5******"}// Response upon request failure{"ErrorCode": "InvalidParam","ErrorMessage": "TaskID missing","RequestID": "95941e2c85898384a95b81c2a5******"}
Parameter | Type | Required | Description |
Action | string | Yes | Requested operation type. To query a recording task, set it to Describe . |
Data | object | Yes | Request protocol parameter. |
Data.TaskID | string | Yes | ID of the recording task to be queried, which can be obtained in the response parameters of the recording start API. |
{"Action": "Describe","Data": {"TaskID": "0f7d9522-a1a3-4517-b5ad-7a6ec******"}}
Parameter | Type | Required | Description |
ErrorCode | string | No | Error code, which will be returned only when a request error occurs. |
ErrorMessage | string | No | Error message, which will be returned only when a request error occurs. |
TaskID | string | No | Recording task ID, which will be returned only when recording successfully starts. |
RequestID | string | No | Request ID. |
Status | string | No | Current recording task status. Valid values: normal: the recording task is successfully created but has not been started yet. recording: the recording task is running. paused: the recording task is paused. canceled: the recording task is canceled. transcode: the recording task is performing an operation on the recorded video such as splicing and transcoding. upload: the recording task is uploading the recorded video to a Tencent Cloud storage service callback: the recording task is notifying the recording result at the callback address configured during recording initiation. finished: all operations of the recording task have been completed. |
CreateTime | int | No | Recording task creation timestamp in seconds. |
StartTime | int | No | Recording task start timestamp in seconds, which will be returned only after recording is successfully started. |
CancelTime | int | No | Recording task cancellation timestamp in seconds, which will be returned only after the recording cancellation request is initiated. |
StopTime | int | No | Recording task stop timestamp in seconds, which will be returned only after the recording task is stopped. |
FinishTime | int | No | Recording task completion timestamp in seconds, which will be returned only after all operations in the recording task are completed. |
Result | object | No | Recording task result. |
Result.ErrorCode | string | No | Recording task error code, which will be returned only if an error occurs during recording task execution. |
Result.ErrorMessage | string | No | Recording task error message, which will be returned only if an error occurs during recording task execution. |
Result.Videos | []object | No | List of recorded video files. |
Result.Videos.Filename | string | No | Video filename. |
Result.Videos.FileSize | int | No | Video file size. |
Result.Videos.FileDuration | string | No | Video file duration. |
Result.Videos.FileId | string | No | If the target is VOD, this parameter is the unique ID of the media asset file in VOD. |
Result.Videos.FileURL | string | No | Video file URL. |
// Response upon request success{"TaskID": "7a035551-d9d6-494e-b604-fa787b******","RequestID": "95941e2c85898384a95b81c2a5******","CreateTime": 1620982173,"Status": "finished","StartTime": 1620982177,"CancelTime": 1620982203,"StopTime": 1620982203,"FinishTime": 1620982210,"Result": {"Videos": [{"Filename": "1621406865789.mp4","FileSize": 169780,"FileDuration": 9,"FileId": 31235664578998,"FileURL": "http://web-record-125******.cos.ap-chengdu.myqcloud.com/4d0f336d-4de4-4fc8-b505-d1f790974909/162140******.mp4"}]}}// Response upon request error{"ErrorCode": "InvalidParam","ErrorMessage": "TaskID missing","RequestID": "95941e2c85898384a95b81c2a5******"}// Response upon recording task error{"TaskID": "7a035551-d9d6-494e-b604-fa787b******","RequestID": "95941e2c85898384a95b81c2a5******","CreateTime": 1620982173,"Status": "finished","StartTime": 1620982177,"CancelTime": 1620982203,"StopTime": 1620982203,"FinishTime": 1620982210,"Result": {"ErrorCode": "CallbackFailed","ErrorMessage": "Callback failed even all tries. last error message:ECONNABORTED:timeout of 2000ms exceeded"}}
Was this page helpful?