SPLauncher JavaScript Object
For background information, see Basic Uploader.
The Basic Uploader JavaScript creates the SPLauncher JavaScript object, which you use to launch ScreenPal and commuicate with it.
You may pass it custom data and specify a callback. You may also set up a WebHook callback from ScreenPal servers to your servers when a recording is uploaded.
Include this in your JavaScript file:
Then call the SPLauncher.launch(...) function to start the recorder.
When you embed the JavaScript you can add some extra settings, using customData and callback as seen below:
Setting a customData object with key/value pairs will save the data so it's passed back in the callback function and in JSON for the WebHook, if you have one defined.
Setting a callback function will allow you to receive a JavaScript callback after the ScreenPal Recorder is closed. If a recording is uploaded, then the function will be called back with a JavaScript object containing details for the upload OR undefined if no recording was uploaded.
When using the JavaScript callback, the end user should not navigate away from the page where the recorder is launched or else the JavaScript callback won't be called.
The JavaScript object will contain the following details:
If you enabled the option to "Include links and embed tag in javascript callback", then you will also get links and an embed tag to what was uploaded:
You can set up a WebHook callback so a POST request is made from the ScreenPal servers back to your servers when an upload is made. You can supply either an HTTP or HTTPS URL, which can also be prefixed with a username and password for basic authentication like: username:password@http://.... The POST request will contain JSON with the same data provided in the JavaScript callback with all the links to the upload that was created like:
If the system fails to post to your server then it will retry until it successfully posts.
When calling SPLauncher.launch(...), you may specify options using properties. See SPLauncher Properties for details on those properties.