Skip to main content

RecordingConfig

RecordingConfig contains events pertaining to the lifecycle of the video recording itself. Once the user has selected the mode, devices that he wants to use, and starts his recording, use these callbacks to maintain, receive and store relevant data for the video.

const RecordingConfig = {
onStart: (err, videoId) => {}, // recording starts
onFinish: (err, rawData) => {},, // finish recording is pressed
onPause: (err) => {}, // recording paused
onResume: (err) => {}, // recording resumed
onCancel: (err, videoId) => {}, // recording cancelled
onMute: (err, mute) => {}, // user mutes audio device during recording
onUploadProgress: (err, percentage) => {}, // periodically called with upload progress
onUploadFinish: (err, urls) => {}, // video fully uploaded and processed
onThumbnailFinish: (err, thumbUrl) => {}, // thumbnail fully generated and uploaded
onTranscription: (err, transcriptionData) => {}, // onTranscription call completed
onGendocFinished: (err, genDoc) => {}, // Doc generation call completed
onSreenshotFinish: (err, screenshotData) => {}, // Screenshot generation completed
onGenVoiceScriptFinish: (err, scriptData) =>{}, // Voice scripit completed
onGeneratedVoiceFinished: (err, voiceOver) =>{}, // voicer over generation completed
onInitiateGenVideoFinished: (err, initGenVideo) =>{}, // Initiated Gen video finished
getGenVideoFinished: (err, genVideoFinished) =>{} // Generated video finished
};

Callback Parameters​

err

A standardized error object, returned either during session init or on session termination. When no errors occur, the value is null.
More details regarding error object to be added soon.

Type: bool

videoId

The VideoID is the unique id generated for the video session.

Type: string

rawData

Emitted as the user stops the recording. Do note that uploads happen asynchronously in the background, but sometimes take a few seconds extra to finish after the user is done. The blob or raw data is a local version of the recording that you can use to show your users a preview of the video while SX RecorderSDK uploads the recording to the cloud; as a replacement to the CDN URL of the video to provide a seamless experience.

Type: video blob

mute

onMute is triggered everytime the audio source is is muted/unmuted during the recording.

Type: bool

percentage

onUploadProgress is called once every second after recording begins. percentage here returns NaN as long as the recording is in progress. Once the recording is finished, percentage is a number signifying the progress % of the video being uploaded to the server.

Type: NaN/number

urls

Structure:

{
"billed": 0,
"client_id": "your client ID",
"created_at": "2018-01-01T00:00:00.000Z",
"location": {
"bucket": "your bucket name",
"path": "your path",
"region": "your bucket region"
},
"urls": {
"main": "https://your-bucket.s3.amazonaws.com/your-video-path"
},
"metadata": null,
"source": 3,
"status": 200,
"updated_at": "2018-01-01T00:00:00.000Z",
"user_id": "your user ID",
"video_id": "your video ID"
}

Type: object

thumbUrl

Structure:

{
"thumbnailUrl": "https://your-bucket.s3.amazonaws.com/your-thumbnail-path",
"gifThumbnailUrl": "https://your-bucket.s3.amazonaws.com/your-gif-thumbnail-path"
}

Type: object

transcriptionData

Structure:

{
"audio_url": "https://storage.googleapis.com.....",
"created_on": "2024-06-27T08:06:20.000Z",
"deleted": 0,
"duration": 10560,
"gcp_response": "{\"stt\":{\"data\":{\"results\":[{\"alternatives\":.....................}",
"id": "1719475608",
"language": "en-US",
"status": 200,
"transcript_url": "https://storage.googleapis.com.....",
"video_id": "lxwzcq5bcoikci0x7",
"updated_on": "2024-06-27T08:06:20.000Z"
}

Type: object

genDoc

Structure:


"data": [
{
"Descriptive Text": "Click on the first element on the page.",
"UserAction": "Click",
"VoiceOver": "this is the first click",
"timestamp": 2008
},
{
"Descriptive Text": "Click on the element that says \"Embrace the future of the video express bye\".",
"UserAction": "Click",
"VoiceOver": "Embrace th futre",
"timestamp": 8468
}
]

Type: object

screenshotData

Structure:

{
"screenshots": [
{
"2008": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAA........"
},
{
"8468": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAA........"
}
]
}
info

The key "2008" indicates the timestamp when the screenshot was generated, with its corresponding base64-encoded image data.

This structure ensures that each screenshot is uniquely identified and can be easily retrieved based on its timestamp.

Type: array

scriptData

Structure:

{
"data": {
"step_0": "Okay, so first things first, I need to head over to the Installation Page. That's where I'll find all the instructions for setting up the StoryXpress Record",
"step_1": "Once I've got that sorted, I'll check out the Additional Helpers Page. They've got some extra resources and tools there that might make recording even easie"
}
}

Type: object

voiceOver

Structure:

{
"timepoints": [
{
"timeSeconds": 0.3676334023475647,
"markName": "start-0"
},
{
"timeSeconds": 4.4416584968566895,
"markName": "end-0"
}
],
"voiceovers": "https://storage.googleapis.com/.../en-US-Neural2-C-voiceover.mp3"
}

Type: object

initGenVideo

Structure:

{
"data": "successfull accepted the request"
}

Type: object

genVideoFinished

Structure:

{
"created_on": "2024-07-08T05:36:54.000Z",
"id": "1720417029",
"status": 200,
"video_id": "lycjtr4kyxvs47173",
"video_url": "https://storage.googleapis.com/.....flyer.mp4",
"voice": "en-US-Neural2-C"
}

Type: object