API
Reference
initialize
Initializes the sdk. Widgets can be created after successfull initialization.
initialize (
InitializationConfig,
Callback<InitializeResult>
)
InitializationConfig
InitializationConfig {
token: string,
}
InitializeResult
InitializeResult (
successData: {
key: string,
},
errorData: {
error: string,
message: string
}
)
successData
will be undefined if there is an error. Similarly errorData
will be undefined is initialize is successfull
Recorder
create
create(
initializeKey,
RecordWidgetConfig,
WidgetErrorCallback
) => Promise::Success<RecorderInstance> or Promise::Error<CreateError>
The resolved RecorderInstance
is used to access the Recorder methods
In case there is an error while creating the Widget, the Promise is 'rejected' to return CreateError
initialize
methodWidgetErrorCallback
WidgetErrorCallback () => {
error: string,
message: string,
class_name: string
}
errors/#widget-create-errors
More details can be found at WidgetErrorCallback Errors
RecorderInstance
required to access the below APIs
on
Creates a listener for the Recorder events.
on(
event_name: string,
callback: Callback<EventData>
)
Please refer to Events and Data section for more details on the different events for Recorder
open
Opens the created Record Widget.
open()
startRecording
Initiates the recording.
startRecording(
config: RecordingConfig
)
RecordingConfig
. This is optional if its already passed in create
stopRecording
Stops the recording.
stopRecording()
pauseRecording
Pauses the recording already in progress.
pauseRecording()
resumeRecording
Resumes the recording which was paused.
resumeRecording()
cancelRecording
Cancels the recording in progress.
cancelRecording()
Importer
create
create(
initializeKey,
ImportWidgetConfig,
WidgetErrorCallback
) => Promise::Success<ImporterInstance> or Promise::Error<CreateError>
The resolved ImporterInstance
is used to access the Importer APIs
In case there is an error while creating the Widget, the Promise is 'rejected' to return CreateError
initialize
methodImporterInstance
required to access the below APIs
on
Creates a listener for the Importer events.
on(
event_name: string,
callback: Callback<EventData>
)
Please refer to Events and Data section for more details on the different events for Importer
open
Opens the Import Widget.
open()
importMedia
Uploads video/audio file.
importMedia(
file: File
)
Editor
create
create(
initializeKey,
EditWidgetConfig,
WidgetErrorCallback
) => Promise::Success<EditorInstance> or Promise::Error<CreateError>
The resolved EditorInstance
is used to access the Editor methods
In case there is an error while creating the Widget, the Promise is 'rejected' to return CreateError
initialize
methodEditorInstance
required to access the below APIs
on
Creates a listener for the Editor events.
on(
event_name: string,
callback: Callback<EventData>
)
Please refer to Events and Data section for more details on the different events for Editor
open
Opens the Edit Widget.
open()
Additional Types
RecordWidgetConfig
RecordWidgetConfig {
record_config: RecordingConfig
inline: boolean (or) InlineConfig,
video_title: boolean (or) VideoTitleConfig,
retake_video: boolean,
edit: boolean (or) EditConfig,
show_mirror_webcam: boolean,
virtual_background:boolean,
custom_thumbnail:boolean (or) CustomThumbnailConfig,
advanced_settings: AdvancedSettingsConfig
}
VideoTitleConfig
false
will not show the edit option.By default all edit options will be shown which can be further customized with
EditConfig
Defaults to
false
Defaults to
false
CustomThumbnailConfig
Defaults to
false
RecordingConfig
RecordingConfig {
teleprompter: boolean (or) TeleprompterConfig,
show_selectable_options: boolean,
screen: boolean,
webcam: boolean,
mic: boolean,
resolution: string,
enable_markup_tool: boolean,
mirror_webcam: boolean,
max_recording_time: number
}
TeleprompterConfig - Configuration for teleprompter can also be passed
Teleprompter is not available for screen recording.
Defaults to
false
Defaults to
true
Defaults to
true
Defaults to
true
Defaults to
true
Possible values are
"1080"
, "720"
, "480"
or "360"
. Defaults to
"1080"
Defaults to
true
Defaults to
false
ImportWidgetConfig
ImportWidgetConfig {
inline: boolean (or) InlineConfig,
video_title: boolean (or) VideoTitleConfig,
edit: boolean (or) EditConfig,
}
VideoTitleConfig
false
will not show the edit option.By default all edit options will be shown which can be further customized with
EditConfig
EditWidgetConfig
EditWidgetConfig {
editor_config: EditorConfig,
inline: boolean (or) InlineConfig,
video_title: boolean (or) VideoTitleConfig,
edit: boolean (or) EditConfig,
}
VideoTitleConfig
false
will not show the edit option.By default all edit options will be shown which can be further customized with
EditConfig
EditorConfig
EditorConfig {
asset_id: number
}
Widget Events
. This will be present in the
record_details
event for recording and import_complete
event for import.InlineConfig
Opens the widget inside the given HTML element than opening it in a modal.
InlineConfig {
open: boolean,
element: ElementDOM,
element_id: ElementDOM_ID
}
true
VideoTitleConfig
VideoTitleConfig {
title: string,
editable: boolean,
}
true
.TeleprompterConfig
TeleprompterConfig {
script_id: number,
script: string,
change_script: boolean,
text_size: number,
line_space: number,
speed: number
}
0
script_id
is ignored.Defaults to
false
15
Minimum text size
15
. Maximum text size 45
1
The value can be a float, example
1.25
Minimum line space
1
. Maximum line space 3
2
Minimum speed
1
. Maximum speed 10
EditConfig
EditConfig {
trim: boolean,
crop: boolean,
text: boolean,
stickers: boolean,
callout: boolean,
blur: boolean,
image: boolean,
resize: boolean
}
Defaults to
true
Defaults to
true
Defaults to
true
Defaults to
true
Defaults to
true
Defaults to
true
Defaults to
true
Defaults to
true
AdvancedSettingsConfig
AdvancedSettingsConfig {
show_system_audio: boolean,
show_markup_tools: boolean,
show_lower_third: boolean,
show_center_webcam: boolean,
show_webcam_source: boolean,
show_audio_source: boolean,
show_aspect_ratio: boolean,
show_webcam_shape: boolean,
show_webcam_size: boolean,
show_webcam_position: boolean,
show_video_resolution: boolean,
}
Available only for Screen recording
System audio is only availble for 'Tab recording' in MacOS
Defaults to
true
Available only for Screen recording
Defaults to
true
Available only for Screen recording with circle webcam shape
Defaults to
true
Available only for Screen recording
Defaults to
true
Defaults to
true
Defaults to
true
Available only for Screen recording
Available only for Screen recording
Available only for Screen recording
Available only for Screen recording
CustomThumbnailConfig
CustomThumbnailConfig {
default_frame: boolean,
gif_preview: boolean,
upload_new_frame: boolean,
select_frame: boolean,
customize_thumbnail: boolean
}
Defaults to
true
Defaults to
true
Defaults to
true
Defaults to
true
Defaults to
true
Events And Data
The following events are available which can be listened to with the on
API of respective Widgets.
- Recorder
- Import
- Edit
token: Video token for the recorded video.
play_url: Video delivery URL. URL to share/mail/message others.
embed_url: Similar to play_url. Optimized for embedding as an iframe in a website.
embed_preview_url: URL to preview video. (preview will be available at any point of time for the recorded user. For others, it will be the same as 'play_url')
thumbnail_url: Thumbnail URL of the video.
thumbnail_play_url: Similar to 'thumbnail_url', except the play icon is displayed at the center.
error: Detailed message for the error.
upload
- Upload is in progress processing
- Upload has completed and video/audio processing in progressprogress: Upload/Processing progress in percentage
time_remaining (number): Time remaining to complete upload/processing in seconds
time_remaining_formatted: Formatted time remaining to complete upload/processing
HH:MM:SS
message: A short message about the upload/processing operation status
play_url: Video delivery URL. URL to share/mail/message others.
embed_url: Similar to play_url. Optimized for embedding as an iframe in a website.
thumbnail_url: Thumbnail URL of the video.
thumbnail_play_url: Similar to 'thumbnail_url', except the play icon is displayed at the center.
token: Video token for the recorded video.
asset_id: Hippo internal recording identifier.
thumbnail_preview: Gif thumbnail URL of the video,
media_duration: Duration of the imported video
code: A unique code for the error. This can be used to send across to Hippo Video support to identify the error.
message: A detailed error message