edit-icon download-icon

Recording callback

Last Updated: Apr 11, 2018

Function overview

The system calls back the new status of the live recording stream and informs the user of related results and the recording status after recording is completed.

Notes

HTTP/HTTPS URL configurations are supported. The POST request is sent to the user server. The message body is in JSON format. Real-time feedback of the recording result and status information is provided to the user. The user server returns results in the form of 200 responses to the interface. The URL does not need to be identified, but must be accessed properly. If the access times out, you can retry up to five times. The interval between retries is a random value between 100ms and 10s.

Configuration guide

The recording callback address can be manually configured on the console.

2

Example

User callback address: http:// 1.1.1.1/notify/record, the returned body content is as follows:

File generation event callback example

This indicates that the target recording file was generated.

  1. {
  2. "domain": "live.aliyunlive.com",
  3. "app": "live",
  4. "stream": "hello",
  5. "uri": "live/hello/0_2017-03-08-23:09:46_2017-03-08-23:10:40.flv",
  6. "duration": 69.403,
  7. "start_time": 1488985786,
  8. "stop_time": 1488985840
  9. }

Here,domain,app,streamare the recording domain name, application name, and stream name respectively.uriis the path of the target recording file in the user recording OSS bucket.duration,start_time,stop_timeare the duration, start time, and end time of the target recording file respectively.

Example of recording status callback, generated when NeedStatusNotify=true

  • Recording start event callback, indicating the recording has started successfully.
  1. {
  2. "domain": "live.aliyunlive.com",
  3. "app": "live",
  4. "stream": "hello",
  5. "event": "record_started"
  6. }

Here, domain,app, andstreamare the recording domain name, application name and stream name respectively.eventis the event name and it can berecord_started/record_paused/record_resumed.

  • Recording pause event callback, indicating the recording is successfully paused
  1. {
  2. "domain": "live.aliyunlive.com",
  3. "app": "gs_app",
  4. "stream": "gs_stream",
  5. "event": "record_paused"
  6. }
  • Recording error callback, indicating an error occurred during recording
  1. {
  2. "domain": "gs_domain",
  3. "app": "gs_app",
  4. "stream": "gs_stream",
  5. "event": "record_error"
  6. }
Thank you! We've received your feedback.