Documentation
Note: A Boolean value accepts these values: “true” or “1″ for true AND “false” or “0″ for false.
Flash Variables available
All the flash variables are optional.
Note: at least a video or feed flash variable should be set in order to play a video without using the javascript api, although the player will not complain if neither are passed! If both are passed, the values inside the feed take precedence.
- video
This variable accepts a path to a video stream.
This path can be either a path to a local stream (http), a youtube stream (the id or the full url of a youtube video) or a rtmp* stream.
If it’s a local or rtmp stream, the path should contain the extension of the video file and it should be an absolute path for the best results. It works with relative ones too. - videoWidth
Represents the width of the video stream in pixels.
If this variable is passed, it is used even if the movie has metadata embedded.
If it is not passed, the player will look for it in the metadata of the video. - videoHeight
The same as videoWidth, except it represents the height of the video in pixels. - duration
Represents the total duration in seconds of the stream.
If this variable is passed, it is used even if the movie has metadata embedded.
If it is not passed, the player will look for it in the metadata of the video. - fileSize
Represent the total size of the stream in bytes. - previewImage
This variable can be set to hold the path to an image file that will be displayed as a preview for the video clip.
Image types accepted: .jpg, .jpeg, .gif, .png, .swf, youtube id (or entire url: if a youtube id or url is passed, an image is extracted automatically from the feed of the youtube video).
Should be an absolute path, except for youtube, which can be only the video id. - logoImage
This variable can be set to hold the path to an image file that will be displayed in the bottom-right corner of the video.
If the image is bigger than 80 pixels, it is automatically scaled down.
Image types accepted: .jpg, .jpeg, .gif, .png, .swf.
Should be an absolute path. - logoLink
This variable has any effect only if the logoImage variable is set.
This can be set to a url that will be opened in a new window when the logo image is clicked.
It should be an absolute path. - autoPlay
This is a Boolean variable. Default value is true.
If It is true, the video will begin playing as soon as the player loads and data is available.
If it is false, no data will begin downloading until the user sends a play event to the player. - feed
This variable can be set to represent the path to a mrss feed file.
It should be an absolute path.
The values inside the feed file take precedence over those defined using flash variables. - uaid
This variable can be set to represent the Google Analytics Account ID used for tracking. - analyticsFormat
This variable can be used to format the analytics tracking string.
The format string is formed out of combination of parameters.
The parameters are specified in square brackets “[]“.
The default analyticsFormat is: “/[videoString]/[event]?connectUrl=[connectURL]&video=[videoURL]”
The default tracking method is page tracking, but this can be changed to event tracking from within a xml configuration file.
If event tracking is used, the analyticsFormat represents the “action” in the event tracking.
If event tracking is used, the “analyticsCategory” variable must be specified also.
The parameters written inside square brackets will be replaced with the real values:- [videoString] – will be replaced with the entire path of the video (as set in the video variable)
- [event] – will be replaced with the event name and possibly variables (like “play”, “pause”…)
- [connectURL] – will be replaced with the url of connection to the server (in case of local/http stream, this value will be “null”; in case of youtube videos it will be “undefined”; in case of rtmp streams, this will represent the url of the video server)
- [videoURL] – will be replace with the url of the video (in case of local/http streams, this will be the entire video path; in case of youtube video it will be the video id; in case of rtmp stream, this will be the stream name without the server url)
These parameters can be arranged in any combination and order.
- analyticsCategory
This parameter accepts a string, that will represent the Category parameter for the event tracking in Google Analytics.
This parameter is used only if tracking mode is set to event in the xml configuration file. - config
This parameter can be set to be the path to a configuration xml file.
The path should be absolute.
The values in the configuration value take precedence over those declared using flash variables. - stateChangeFunction
This should be set to a name of an existing javascript function designated to receive stateChange events from the player.
The default value is “playerStateChange”.
The function should accept 2 parameters:- objectId – type String: this will be the id of the object tag the player is embedded in
- newState – type int: this will be the new state of the player
The function header:
function playerStateChange(objectId, newState) - errorFunction
This should be set to a name of an existing javascript function designated to receive error events from the player.
The default value is “playerError”.
The function should accept 2 parameters:- objectId – type String: this will be the id of the object tag the player is embedded in
- errorCode – type int: this will be the error code of the player
The function header:
function playerError(objectId, errorCode) - readyFunction
This should be set to a name of an existing javascript function designated to receive the ready event from the player.
The default value is “playerReady”.
The function should accept 1 parameter:- objectId – type String: this will be the id of the object tag the player is embedded in
The function header:
function playerReady(objectId)This method will be called when the player is ready to play clips.
The XML configuration file
In order for the player to make use of a configuration file, the “config” flash variable must be set (described above in the Flash Variables section).
The format of the XML configuration file:
<doply xmlns="http://doply.net/ns/">
<modules>
<cookieModule enabled="true" />
<javascriptModule enabled="false">
<stateChangeFunction>playerStateChange</stateChangeFunction>
<errorFunction>playerError</errorFunction>
<readyFunction>playerReady</readyFunction>
</javascriptModule>
<analyticsModule enabled="true" useEvent="true">
<format>[event] - [videoString]</format>
<category>Videos</category><!-- used only if useEvent="true" -->
</analyticsModule>
<keyboardModule enabled="true" />
<logoImageModule enabled="true" />
<previewImageModule enabled="true" />
<mouseGesturesModule enabled="true" />
</modules>
<playback>
<autoPlay enabled="false" />
<autoLoad enabled="false" /> <!-- not used yet : reserved for later use -->
</playback>
</doply>
Almost everything in this config file is optional.
Actually only the root node is required. The same is true for the namespace.
So the simplest form would be:
</doply>
As you can see, it is pretty useless.
Although everything else is optional, if something is added, the format must be preserved.
For example, let’s say we would like to enable the Javascript module, which is disabled by default. We would have the next xml configuration:
<doply xmlns="http://doply.net/ns/">
<modules>
<javascriptModule enabled="true">
</javascriptModule>
</modules>
</doply>
As you can see from the xml above, we only added what we wanted to change in the xml, and that would work just fine.
Ok, there are a bunch of settings in the configuration file that can be changed, let’s take each and see what are they for.
Let’s start with the “modules” tag.
Inside this tag are the settings for all the modules, which can be enabled or disabled, or further configured where appropriate.
All the module tags have the “enabled” attribute, which is Boolean type: accepts “true” or “1″ for TRUE and “false” or “0″ for FALSE.
If the “enabled” attribute is “false” or “0″, it means that the corresponding module is disabled, otherwise it is enabled. For example, in the xml, the javascriptModule is disabled (<javascriptModule enabled=”true”>).
The Cookie Module
Represented by the <cookieModule> node.
If enabled, the player will store the last value of the volume in a flash cookie, so that if when a user returns, the level of the volume will be remembered.
Later on: remember favorite videos, maybe rating.
The Javascript Module
Represented by the <javascriptModule> node.
If enabled, the player is able to be controlled through javascript function calls, like “doPlay”, “doPause”… The player will, in turn, dispatch events, like playerError, playerStateChange..
The <javascriptModule> node has 3 optional child nodes:
<errorFunction>playerError</errorFunction>
<readyFunction>playerReady</readyFunction>
As their names imply, these 3 nodes specify which javascript functions the player should call when the corresponding events occur: when the player changes state, the “stateChangeFunction” will be called…
The functions are the same that can be configured through flash variables, and are detailed above.
The javascriptModule is disabled by default.
The Google Analytics Module
Probably the most complex and the most valuable module.
Represented by <analyticsModule> node.
Has an optional attribute “useEvent”, which is a Boolean value. Default value is false. If it is true, then the new cool feature from Google Analytics is used: Event Tracking.
This module has 2 optional child nodes:
<category>Videos</category><!-- used only if useEvent="true" -->
The format tag is the same as the analyticsFormat flash variable described in the Flash Variables section.
The category tag is the same as the analyticsCategory flash variable described in the Flash Variables section.

