Skip to main content

Events

When the Shakr Video Editor SDK instance is initialized, you can use event listeners to handle events emitted by the editor.

load

This event is emitted when the editor is initiated without any errors.

editor.on('load', () => {
console.log('The Shakr Editor is successfully loaded!');
// Your custom logic here...
});

confirm_close

This event is emitted when the editor is closed with any unsaved data. For example, you can show a window for confirming that there are unsaved changes made in your application, and allow closing the editor using the .close() function.

editor.on('confirm_close', () => {
if (window.confirm('Are you sure you wish to close the editor? Any unsaved changes that may exist will be lost.')){
editor.close(true);
}
});

finish

You can retrieve the video URL when rendering is completed and the video is ready. This event can be emitted when the wait_rendering option is activated in the Video Editor SDK.

editor.on('finish', ({ video_download_url }) => {
// User finished editing the render session, it'll start rendering now
console.log('User has finished editing render session ' + editor.render_session_id);
console.log('Video url: ' + video_download_url);
});

Please refer to SDK Reference for more information.