Viewer Integration
When you make a request to start a new screen share, the JSON content that you get back will contain a viewerUrl. You can integrate the viewer by either redirecting the user to the viewerUrl or embedding the viewerUrl into an iframe.
Request
The viewer can be customized by adding optional query string parameters to the viewerUrl:
| resize | Either fit (fit the screen view to the display area) or actual (show the screen at its actual size). Defaults to actual. |
| showStop | Either true or false. If this parameter is set to true, a bar will display at the top of the viewer with a Stop button. Defaults to false. |
| showResize | Either true or false. If this parameter is set to true, a bar will display at the top of the viewer with a drop-down that the user can use to toggle the view between "Fit to window" and "Actual screen size". Defaults to false. |
| redirectOnError* | A URL to which the user should be redirected if there is an error. If omitted, an error message is displayed. |
| redirectOnEnd* | A URL to which the user should be redirected when the screen share ends. If omitted, a message is displayed to inform the user that the screen share has ended. |
| titleLinkUrl | Your company name will display in the title bar of the viewer. If you provide a titleLinkUrl, the company name will be hyperlinked to this URL. If this parameter is omitted, the company name will not be hyperlinked. |
Response
HTTP status codes are used to indicate the result of the request:
| 200 - OK | The HTML for the viewer was returned successfully. |
| 401 - Unauthorized | The viewerUrl is missing the accountid query string parameter. This shouldn't normally happen as the viewerUrl the we return to you already includes the accountid. |
| 403 - Forbidden | An attempt was made to access a screen share that wasn't started through the API. |
Viewer Customization Wizard
The Screenleap API demo lets you try out each of the customization options above. We recommend that you use it to find the configuration that will work for you, then copy the URL from that page to use in your application.
Some sample custom viewer URLs are also provided below.
Loading the viewer into an iframe:
The viewer will not have any of the Screenleap interface, so the viewer fits seamlessly within the containing web page. To enable the viewer to cancel viewing the screen share, add a button that changes the URL of the iframe.
Open the viewer in a new page:
This URL will open a viewer with the standard control bar at the top that includes the stop button and resize toggle.
