Solution Builder API
SPLauncher JavaScript Object
6min
overview for background information, see implementation details docid 42txky0k3olytswsglysh 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 start the recorder include this in your javascript file \<script type="text/javascript" src="https //myhost/sp/sp launcher 3 0 x js">\</script> then call the splauncher launch( ) function to start the recorder custom data and callback when you embed the javascript you can add some extra settings, using customdata and callback as seen below \<script type="text/javascript" id="sp recorder recorderid" src="//screenpal com/api/sp js"> \</script>\<script type="text/javascript"> sp recorder({ id "recorderid", customdata {"key1" "value1", "key2" "value2" }, callback function(screencast) { } }) embed(); \</script> 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 { "id" "recordingid", "title" "title entered by user", "description" "description entered by the user (or empty string if nothing was given)", "customdata" { customdata you provided if any } } 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 { "id" "recordingid", "title" "title entered by user", "description" "description entered by the user (or empty string if nothing was given)", "customdata" { customdata provided in javascript }, "watchlink" "http //link/ to the playback page for the upload", "channellink" "http //link/ to the channel page for the upload", "downloadlink" "http //link/ to download the mp4 for upload which expires after 1 hour", "embedtag" "\<frame>tag to embed a player for the upload\</frame>" } webhook callback 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 { "id" "recordingid", "title" "title entered by user", "description" "description entered by the user (or empty string if nothing was given)", "customdata" { customdata provided in javascript }, "watchlink" "http //link/ to the playback page for the upload", "channellink" "http //link/ to the channel page for the upload", "downloadlink" "http //link/ to download the mp4 for upload which expires after 1 hour", "embedtag" "\<frame>tag to embed a player for the upload\</frame>" } if the system fails to post to your server then it will retry until it successfully posts splauncher properties when calling splauncher launch( ) , you may specify options using properties see splauncher properties docid bpkdmtjdpmi02x4qpzcw for details on those properties