- What is ScreenToaster API?
- How to embed the API in a page
- Example of embed code
- How to play uploaded videos
What is ScreenToaster API?
ScreenToaster API is a flash application (swf file) that can be embedded in your website. You can register to ScreenToaster API for your domain (example.com) or for a specific server (www.example.com). The url of the page on which the API is embedded will specify which ScreenToaster account it has to be linked to.
For example, say you run ScreenToaster API on video.example.org/en_US/videos/screencast. All the uploaded videos will be linked to the account linked to example.org domain or to video.example.org server name.
How to embed the API in a page
Here is the HTML code to place in the page using the API.
width="950" height="485"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"
data="http://www.screentoaster.com/swf/STRecorder.swf"
type="application/x-shockwave-flash">
<param name="movie" value="http://www.screentoaster.com/swf/STRecorder.swf" />
<param name="allowScriptAccess" value="always" />
<param name="allowFullScreen" value="true" />
<param name="flashvars" value="[flashvars]" />
</object>
[flashvars] has to be replaced with parameters to configure your application.
[flashvars] has the following syntax:
parameter1=value1¶meter2=value2¶meter3=value3...
Available parameters for [flashvars]:
- ext_user_id
This parameter allows you to pass a reference to the user using the API to create screencasts.- required: no
- default value: empty
- ext_additional_data
This parameter allows you to pass any data you need to ScreenToaster API. These information will be stored with the screencast information.- required: no
- default value: empty
- st_visibility_on_portal
This parameter allows you to change the visibility of the screencasts created with the API.- required: no
- default value: private
- possible values: private/public/select/hidden
- private: videos created in private mode will be indexed neither by ScreenToaster.com nor by search engines like google / yahoo etc.
- public: videos created in public mode will be indexed by ScreenToaster.com
- select: lets the user decide between public and private before uploading.
- hidden: videos created in hidden mode cannot be viewed by anyone except its author.
- forward_url
Setting a forward url allows you to redirect the user to an url of your choice once the video uploaded. You can use a template url to use some parameters.- required: no
- default value: url of the video on ScreenToaster
- template patterns:
- #{st_video_id} will be replaced by the id of the video uploaded
- #{ext_user_id} will be replaced by the parameter you gave in ext_user_id
WARNING: Flashvars must contain & char to separate parameters, so, if you need to use & in your forward url, you'll have to encode it. Its code is %26. See example below.
forward_url=http://www.example.com/videos/watch?video=#{st_video_id}%26user=#{ext_user_id}
Example of embed code
Here is an example of html code you could use to embed ScreenToaster API in your website.
width="950" height="485"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"
data="http://www.screentoaster.com/swf/STRecorder.swf"
type="application/x-shockwave-flash">
<param name="movie" value="http://www.screentoaster.com/swf/STRecorder.swf" />
<param name="allowScriptAccess" value="always" />
<param name="allowFullScreen" value="true" />
<param name="flashvars" value="forward_url=http://www.mywebsite.com/videos/watch?video=#{st_video_id}%26user=#{ext_user_id}&st_visibility_on_portal=public&ext_additional_data=Some_useful_infos_for_you&ext_user_id=username" />
</object>
How to play uploaded videos
If you use forward_url (see [Flashvars]) you can get the videoId of uploaded videos, thus you can embed a ScreenToaster player to play these videos on your website. Here is the html code:
width="425" height="344"
type="application/x-shockwave-flash"
data="http://www.screentoaster.com/swf/STPlayer.swf"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0">
<param name='movie' value='http://www.screentoaster.com/swf/STPlayer.swf"/>
<param name="allowFullScreen" value="true"/>
<param name="allowScriptAccess" value="always"/>
<param name="flashvars" value="video=[st_video_id]"/>
</object>
Where [st_video_id] is the id of the video you want to play.
Callback functions
function STApiReady()
function STRecorderReady()
function STRecordingStart()
function STRecordingPause()
function STRecordingResume()
function STRecordingStop(duration, fileSize)
function STUploadStart()
function STUploadProgress(current,total)
function STUploadSuccess(hashcode)
function STAuthError()
function STUploadError()
function STRecordingError()
function STUnexpectedError()
function STMovConversionStart()
function STMovConversionProgress(progress)
function STMovConversionSuccess(filename)
function STMovConversionCancel()
function STMovConversionError()
Available functions
api.getHttpPort();
api.loadRecorder();
api.startRecording();
api.stopRecording();
api.upload();
api.selectArea(b);
api.startMovConversion();
api.cancelMovConversion();
api.setVideosInfos(title, description, tags,lang);
api.setVideoPrivacy(privacy);
api.getAvailableLanguages();
api.useMicrophone();
api.isRecorderLoaded()