CloudHub Docs
Download Documents

Cloud Recording


Cloud recording SDK

Interface related

startPlay

Start playback

CloudHubPlayback.startPlay(onSuccess); 

Parametric:

NameDescription
onSuccessEnter the callback for successful playback, the function ((data) =>{}), where data is the setting of the room (room.json)

Note: The method in the playback must be called after the successful callback

getEngine

Get a new engine。

console.log(CloudHubPlayback.getEngine()); 

The return parameters are:

NameDescription
engineA new engine is the same as the instance in cloudhub-electron-sdk

Note: The new RtcEngine needs to replace the old RtcEngine. The new RtcEngine needs to be used in the playback program. It has all the properties and methods of the old RtcEngine, and the parameters passed when used need to be the same as the original ones.

getChannelId

Get the room number of the current playback program。

console.log(CloudHubPlayback.getChannelId()); 

The return parameters are:

NameDescription
channelIdCurrent room number

setRecordPosition

Set the playback progress.

CloudHubPlayback.setRecordPosition(60000); 

The return parameters are:

NameDescription
positionProgress (unit: ms)

Note: Only fast forward, not backward! If you want to rewind after fast forwarding, it is recommended to refresh the page and start again. After calling the fast forward method, all the behaviors in this period will be returned by callback within a few seconds. At this point, your project is already in the timeline after fast forward. If you go backwards, duplicate data will occur. forExample:Fast forward to ten minutes first, and the project is now ten minutes later. All the behaviors in the first ten minutes have been returned. If you go back to five minutes at this time, the sdk will return data from five minutes. Then these actions between five and ten minutes will be repeated again, which will become duplicate data. Possibly, it will cause unnecessary problems in your project。

sendError

Send error message.

CloudHubPlayback.sendError(message);

If there is an error, you can call Cloud Hub Playback.send Error(message) to write to the server log


Detailed content

Web Address

The address of your playback program.

It is recommended to use http or https link, the local path may cause the playback not to enter.

Record Address

The data file of a certain channel you need to record

Note: CloudHub will call cloudhub-electron-sdk on you. During this period of the recording method, record your actions in this file. For the method of obtaining this file, please consult the docking personnel.

Switch mode

You can set the tuning mode in the system settings

Note: Debug mode is turned off by default. Turn on the debug mode before opening the player, and the started playback program will automatically open the console and output the logs related to the playback SDK.