External factors can cause problems with web page recording, including the following:
To ensure reliability and consistency in the face of network issues, Agora recommends the following best practices.
Take the following steps to ensure that the recording service starts successfully:
start
request is successful, that is, you receive a sid
(recording ID) from the response. If the request fails, take measures according to the HTTP status code:40x
, check the parameter values in your request.50x
, you can retry several times with the same parameters until you receive a sid
. Agora recommends that you use a backoff strategy, for example, retry after 3, 6, and 9 seconds successively, to avoid exceeding the QPS limits. If you retry three times and still do not get a sid
, retry with a new user ID.65
, retry with the same parameters. Agora recommends that you use a backoff strategy, for example, retry after 3 and 6 seconds successively.sid
, use a backoff strategy to call query, for example, retry after 5, 10 and 15 seconds successively. If the query call succeeds, and status in serverResponse is 4
or 5
, it means the recording service starts successfully. Otherwise, you can deem the recording service as not having started, or quit halfway after starting.Before starting web page recording, you need to complete the page detection logic of the JavaScript of the web page to be recorded to implement the following solutions:
start
to start web page recording, the web page recording browser accesses and loads the web page to be recorded.sid
) associated with the web page recording service callback informs the business server that the recording service has started successfully.Agora recommends that you use the detection logic of the page to be recorded to determine if the recording fails to start, that is, if the business server fails to receive a callback that indicates that the loading of the web page is as expected. In such a case, you should reinitiate the recording request.
Open the message notification service, and subscribe to the 71 web_recorder_stopped
callback event. When the business server receives the web_recorder_stopped
callback and the code is not 0
, it means that the web page recording has stopped abnormally. Agora recommends that you restart the recording process and create a new recording.