Solution Builder API
SPLauncher JavaScript Object

SPLauncher Properties

20min

Overview

See SPLauncher JavaScript Object for background information.

This document specifies the properties you may pass to the SPLauncher.launch(...) call.

Required Properties

These properties are required to be specified:

Partner Information

Set the Partner information you were given when you licensed ScreenPal Solution Builder.

JS


jarHostPath

This property provides the URL path where the JARs and zip files are hosted on your system for download by your customers. Be sure to replace any spaces in your path with %20.

JS


JAR File Names

Use the JARs identified to you when you licensed ScreenPal Solution Builder.

JS


callback:function

Your function that gets called with the result of the launch attempt.

JS


The returned value is an object with the following result.* properties. 

result.type: (string)

Value

Description

success

The recorder has launched and should be showing soon on the screen.

failed

The recorder failed to launch.

already

The recorder is already running.

unsupported

The current device is unsupported. Check result.unsupportedType for the reason.

result.launchType: (string)

Value 

Description 

`string`

If result.type == 'success' , then this is the string for the launch type used "java" or "protocol".

result.protocolNoInstallMarked: (true or undefined)

  • If checkInstallMark=true in options was passed to the launcher, then the script checks here first to see if there was a previous install marked successful in this browser. The script returns failure right away if no previous install was marked successful. result.protocolNoInstallMarked: ( true or undefined )

result.protocolInstalled: (true, false, or undefined)

  • In browsers for Win8+IE10+ and Firefox, detection of an installed custom protocol is available. If the current browser has the detection feature, this value is set to true or false depending on whether the custom protocol is installed. If the browser doesn't support the detection then this will be undefined .

result.protocolUserCancelled: (true, false, or undefined)

  • In browsers for Win8+IE10+, detection of a user clicking cancel (rejecting) the custom protocol is available. If the current browser has this feature, this value is set to true or false depending on the user response to the prompt (to run the custom protocol or not). If the browser doesn't support the detection, then this value will be undefined

result.unsupportedType: (string)

Value 

Description 

oldMac

This browser is running on a mac that is older than 10.7, so it can't run the recorder. 

notWinORMac

This browser isn't running on a Windows or Mac PC, so it can't run the recorder.

result.error: (string)

  • If there is an error while launching, this value is set to a string that you can use to help debug. Only valid when using the optional remoteStatusService .

Optional Properties

These are optional properties you may choose to specify:

timeouts

The optional timeout in seconds that causes the code to wait before designating that a particular launch option failed. You can also set up a different timeout to use if the launch type has previously succeeded on this computer, so you can wait longer for it to work using the protocolAfterSuccess and javaAfterSuccess timeouts. The default values are:

JS


checkInstallMark

Set this optional property to true if the script should only try protocol launcher if it finds that the install was attempted from this browser.

JS


remoteStatusService

The JavaScript polls localhost ports looking for the ScreenPal Recorder to start. If you are using https, this may cause warnings in the browser console (browser dependent). The warnings include insecure access. To remove these warnings, create a remote service on your server that the JavaScript will poll and the Recorder will notify when it has been started. The service requires two endpoints. One that the Recorder notifies, which is the updateStatus URL, and a second that the JavaScript polls, which is the pollStatus URL.

updateStatus

  • The updateStatus is a URL that the ScreenPal Recorder will POST to upon startup to report the status for this launch. The POST body will be JSON like:
JS


pollStatus

  • The pollStatus is a URL that the JavaScript uses to (long) poll for the status update. The result of the GET request should be JSON like:
JS

  • If no status is reported yet, then the STATUS would be an empty string. Otherwise, it should be the status string reported in the updateStatus call. The pollingInterval is an optional timeout (in seconds) that the JavaScript uses when calling the server (with a default value of 5 seconds). Make sure to encode the URL parameter in the updateStatus and pollStatus with globally unique IDs to allow your service to distinguish callbacks.
JS


properties

The properties map is used to pass properties to configure the recorder after its launched.  For example if you are using the Basic Uploader then it will have a set of properties needed which you will pass via the properties map.

JS


There are also a few properties which can be used regardless of the Uploader chosen:

showManager

You may choose to open the ScreenPal Editor directly, without first making a recording, to show local computer recordings to edit and publish. 

JS


SOMLauncher.setMarkInstall()

If you set the checkInstallMark:true in the options to launch(), then use this function to mark when you have shown the download to the user. This helps the Launcher to only try the protocol launch if the install was downloaded. If the install has not been marked during this instance of browsing, then the launch will call back with result.protocolNoInstallMarked = "true".