KDP evaluate method: introduction
KDP provides a method to query and retrieve dynamic data available through the KDP model.
"evaluate" is a static function, available both as a public method (to those who extend KDP or embed it within flash/flex app) and via externalInterface.
Usage: query data and construct strings
evaluate works in a similar way to how mxml text strings works. To retrieve a value of a certain parameter that exist on the KDP model, we pass the evaluate method a string that contains the name of the parameter wrapped in curly braces. All text that is not wrapped in curly braces will be interpreted as simple text.
For example, the following will query the kdp for the value of the playhead time (current playback time):
kdp.evaluate("{video.player.currentTime}");
It is also possible to query a property of an object that exist on the KDP model.
For example, the following will query the kdp for the value of the id property of the entry object representing the currently playing media:
kdp.evaluate("{mediaProxy.entry.id}");
Common variables that can be evaluated
The following list describe all the available variables that can be retrieved through the KDP evaluate JS function.
Note: in addition all the page defined flashvars will be available and all modules, controllers and containers will be available by their respective id.
-
autoplay- As it was defined by the autoPlay flashVar -
currentTime- The playhead time (in milliseconds, the time currently being played within the media) -
debugmode- As it was defined by the debugMode flashVar -
downloadUrl- A direct link to the media file being played ready for download -
duration- Total duration (in seconds) of the playing Media -
entry- The kaltura entry object representing the playing media (type: com.kaltura.vo.KalturaMediaEntry) -
entryid- The id of the Kaltura entry currently playing -
entryType- The type of the Kaltura entry currently playing (relating to: KalturaMediaType) -
host- The Kaltura Server hosting the playing media -
isInFastForward- Determines whether KDP is now in fast forward playback mode (true if currently playing in fastforward) -
kalturaClient- The Kaltura Client used to connect the client library to the Kaltura API (holds the ks & url params as well, type: com.kaltura.KalturaClient) -
kalturaDomain- The Kaltura Server domain that hold the playing media (e.g. "http://www.kaltura.com/") -
kdpEnabled- Determines whether KDP UI is now enabled or disabled ("can the user click the ui?") -
kdpState- The application state the KDP is on (relates to KdpPlayerStates) -
kdpurl- The url of the KDP swf application file as it was passed through the KDP wrapper -
ks- The Kaltura Session the KDP is currently using -
k_watermark_click_path- The url the browser will be redirected to when the user clicks the watermark (e.g. "http://www.kaltura.org") -
localUiFunc- The name of the function that will be called by the KDP to retrieve locally defined uiConf XML (e.g. "getLocalUi"), if null or empty string KDP will not try to retrieve local uiConf and use the uiConf from the widget.get service -
logstatsF- The name of the function the KDP will call to print the log stats (e.g. "logStats"), if null or empty string KDP will not output statistics events to javascript -
mediaDescription- The description of the media currently playing -
mediaSession- Random number unique to the KDP instance, this number is used to track unique KDP statistics -
mediaTags- The tags of the currently playing media -
mediaTitle- The name (title) of the currently playing media -
objectId- The id of the KDP object in the page (as defined on the object tag) -
partnerid- The partner id being used for this KDP session -
skinUrl- The path or full url to the currently used compiled Flex skin -
uiconfid- The id of the uiConf that was loaded -
userid- The id of the user being used for this KDP session -
widgetid- The KDP widget id used (Widget id configure a specific KDP design + configuration)



