Screen Recorder Launcher API Functions
These files can be hosted anywhere on your servers but for the purchase of this article we'll assume they are all uploaded to a folder on your server accessible at https://myhost/SOM
Then call the SOMLauncher.launch(...) function to start the recorder.
The launch function takes several options detailed below. Most implementations will use the Basic Uploader which will require options also detailed in the Configure the Basic Uploader. If you are developing a custom user interface (UI) or custom upload endpoint, such as to your backend or a cloud service not supported in the Basic Uploader, then you can go to Configure the Custom Uploader.
Several options can be passed through the function named SOMLauncher.launch(...).
When using the SOMLauncher.launch() function, set the following properties:
Specify the partner information when adding API code to your website.
This property provides the URL path where the jars and zip files are hosted on your system for download by the user (replace any spaces in your path with %20).
These are provided by ScreenPal.
All jars must be signed by the same certificate.
This required function is called back with result of the launch attempt.
The returned value is an object with the following result.* properties.
The recorder has launched and should be showing soon on the screen.
The recorder failed to launch.
The recorder is already running.
The current device is unsupported. Check result.unsupportedType for the reason.
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 if 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 .
This browser is running on a mac that is older than 10.7, so it can't run the recorder.
This browser isn't running on a Windows or Mac PC, so it can't run the recorder.
- 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 .
When using the SOMLauncher.launch() function, the following optional properties can be set:
The launching options and order they should be tried for Windows or mac. The defaults shown below default to not trying java in Chrome (Chrome does not support Java any more). The launcher script remembers if a method had previous success and attempts to launch that first upon subsequent launches. For example, using the default values below, if the "protocol" method worked on the previous attempt, then the script will try that first instead of trying "java" first.
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:
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.
- The updateStatus is a URL that the recorder will POST to upon startup to report the status for this launch. The POST body will be JSON like:
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.
There are also a few properties which can be used regardless of the Uploader chosen:
When using the screen recorder and video editor you can launch the editor without first doing a screencast to open a window showing local recordings on the computer by setting this property to true.
If you set the checkInstallMark:true (in the options to the launch() function), 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" .