Kaltura Dynamic Player version 3
KDP is an application that utilize Adobe OSMF, PureMVC and Yahoo ASTRA ui components to enable creation of pluggable, robust and easy to design media players.
FlashVars (Parameters)
KDP enable overriding of any internal KDP object or parameter via flashvars. To override values use the standard OOP dot notation: objectId.parameter=value or in case of public properties parameter=value . Flashvars are properties and attributes that can be set on the page when embedding the KDP instance
-
Connecting to the Kaltura Services
-
httpProtocol
The http protocol to load the KDP application from
Default: Trimed protocol of the url the KDP was loaded from
-
host
The url of the Kaltura server to work with
-
cdnHost
The base url of the CDN to load media and assets from
Default: The host parameter value
-
clientTag
A custom text that will be concatenated to KDP version, this tag is used by the Kaltura server widget caching mechanism and for tracking and analytics
Default: KDP:KDP_VERSION
-
srvUrl
Reserved for future use, determine the API services part of the base Kaltura API calls
-
partnerId
The id of the Kaltura partner whos media to play
-
ks (Kaltura Session)
Default: By default, the KDP will generate a ks by calling the widget.get api
-
referrer
The url of the hosting web page for tracking and analytics
-
Kaltura MediaEntry
-
entryId
Valid Kaltura media entry id or a media url (to use url set sourceType=url)
-
flavorId
The flavor asset id of the media entry being played (applicable only when sourceType=entryId)
How to get the flavor asset id?
- Open the KMC and login to your partner account
- Go to the content tab
- Click on the name of the media entry whos flavor asset you want
- Click on the Flavors tab (on the left sidebar)
- Copy the id on the 'Asset ID' field of the specific transcoding flavor you wish to play
Transcoding Flavors: Flavors represent the various encoding qualities a Kaltura video entry is converted to. Flavor profiles are managed in the KMC (Kaltura Management Console) inside the Settings tab under 'Transcoding Settings'. When using the KMC upload view, to control which flavors will the uploaded video be converted to, select the desired profile next to the upload button. When using the contribution wizard from your site, set the value of 'kvar_conversionQuality' flashvar to the id of the transcoding profile to use (To get the id of the profile, enter the Advanced Mode inside the 'Transcoding Settings' view in the KMC Settings tab.
-
preferedFlavorHeight
The height to prefer when dynamically selecting the transcoding flavor. If no flavor is defined by this height, will choose the closest.
-
sourceType
The type of media source to load, either a url or id of valid Kaltura media entry
Default: entryId
Options:
- url: The media will be loaded from a url, the entryId parameter will be a url
- entryId: The media will be loaded from the Kaltura Server as Kaltura Entry, the entryId parameter will be a valid id of a Kaltura Entry
-
streamerType
The media source streaming protocol to use
Default: http
Options:
- http: The media will be loaded using http based progressive download
- rtmp: The media will be loaded from FMS VOD streaming
- live: The media will be loaded by connecting to a live broadcast
-
streamerUrl
A full rtmp url to the streaming application that will be used as the streaming provider, e.g. 'rtmp://rtmpakmi.kaltura.com/ondemand' (Used by the FMSURL OSMF class)
-
streamFormat
Defines the video type of the rtmp stream to be played. To play mp4 streams over rtmp, pass streamFormat=mp4
Default: undefined
Options:
- undefined: FLV videos
- mp4: MP4 videos
-
rtmpFlavors
Determine whether to use a multi-bitrate content flavors for dynamic streaming
Default: undefined
Options:
- undefined: Single flavor (no dynamic bitrate switching)
- 1: Use multi-bitrate (setting to 1 will switch the played stream quality according to the user connection)
-
Player Layout and Functionality
-
widgetId
The widget id as provided by Preview & Embed in KMC (if unsure use _partnerId e.g. _309)
-
uiConfId
The player uiConf id as provided by the Application Studio in KMC (or by calling uiConf.add api)
-
kml
The source from which to load the Kdp uiConf (KML=Kaltura Meta ui Language), if undefined the kml will be loaded from the Kaltura server via uiConf.get api
Default: undefined
Options:
- local: Load from an xml file specified by kmlPath parameter
- injet: uiConf will be injected by the wrapping application using the init() kdp function (This method is used by the Application Studio for preview functionality)
-
kmlPath
An accessible path to valid kml file (use with kml=local)
Default: config.xml
-
embeddedWidgetData
Valid uiConf XML result, this is used by the 'KDP wrapper'; A flash application that wraps the KDP for caching purposes
Default: null
-
disableAlerts
Disable the alert boxes
Options:
- true: Kdp will not show alerts on notifications
- false: Kdp will show alerts on notifications
-
fileSystemMode
Use to load the uiConf xml and skin assets from predefined path when debuggin or loading KDP from local file system
Default: false
Options:
-
debugMode
Reserved for future use or use by plugins; will usually be used to allow Flash trace commands
Default: false
Options:
-
Playback Control
-
autoPlay
Auto play single media (doesn't apply to playlists)
Default: false
Options:
-
autoRewind
Determine whether the first or the last frame of the media will show when playback ends
Default: false
Options:
-
autoMute
Determine whether to start playback with volume muted (usually used by video ads or homepage auto playe videos)
Default: false
Options:
- true: KDP will start playback muted,false:KDP will playback regularly
- false
-
Player Design and Locale
-
uiConfLayoutId.skinPath
Sets the url of the skin swf file to load. uiConfLayoutId is the id of the layout in the uiConf xml identifying the current Kdp UI
Options:
- Full url: A full url to the skin.swf file
- Relative path: A relative path to the skin.swf file - it will be concatenated to the httpProtocol and cdnHost paramerters
-
strings.ALERT_ID
An object that contains the text of the messages kdp alert in various situations, use the following syntax: strings.MESSAGE_KEY=the message to alert. For example, to set the alert message that will be displayed when the media is accessed in a forbidden country use: strings.UNAUTHORIZED_COUNTRY=This video is not available at your country
Available messages:
- UNAUTHORIZED_DOMAIN_TITLE: Un authorized domain
- UNAUTHORIZED_COUNTRY_TITLE: Un authorized country
- OUT_OF_SCHEDULING_TITLE: Out of scheduling
- NO_KS_TITLE: No KS where KS is required
- ENTRY_CONVERTING_TITLE: Entry is converting
- ENTRY_REJECTED_TITLE: Entry is rejected
- ENTRY_DELETED_TITLE: Entry is deleted
- ERROR_PROCESSING_MEDIA_TITLE: Error processing media
- FREE_PREVIEW_END_TITLE: Free preview completed need to purchase
- ENTRY_MODERATE_TITLE: Entry is awaiting moderation
- ENTRY_PRECONVERT_TITLE: Entry is converting
- ENTRY_IMPORTING_TITLE: Entry is converting
- UNKNOWN_STATUS_TITLE: Unknown status
- SERVICE_ERROR: Service error
- CLIP_NOT_FOUND: Media not found
- CLIP_NOT_FOUND_TITLE: Sorry clip not found
- NO_MIX_PLUGIN_TITLE: No Mix Plugin
- SERVICE_GET_EXTRA_ERROR_TITLE: Error Get Extra Data
- UNAUTHORIZED_DOMAIN: Were sorry this content is only available on certain domains
- UNAUTHORIZED_COUNTRY: Were sorry this content is only available in certain countries
- OUT_OF_SCHEDULING: Were sorry this content is currently unavailable
- NO_KS: Were sorry access to this content is restricted
- ENTRY_CONVERTING: Media is currently being converted please try again in a few minutes
- ENTRY_REJECTED: Were sorry this content was removed
- ENTRY_DELETED: Were sorry this content is no longer available
- ERROR_PROCESSING_MEDIA: There was an error processing this media
- FREE_PREVIEW_END: Access to the rest of the content is restricted
- ENTRY_MODERATE: Media is awaiting moderation
- ENTRY_PRECONVERT: Media is currently being converted please try again in a few minutes
- ENTRY_IMPORTING: Media is currently being converted please try again in a few minutes
- UNKNOWN_STATUS: Unknown status
- SERVICE_START_WIDGET_ERROR: Error in Start Widget Session
- SERVICE_GET_WIDGET_ERROR: Error in Get Widget
- SERVICE_GET_UICONF_ERROR: Error in Get Uiconf
- SERVICE_GET_ENTRY_ERROR: Error in Get Entry
- SERVICE_GET_FLAVORS_ERROR: Error in Get Flavors
- SERVICE_GET_EXTRA_ERROR: Error in get base entry extra data
- NO_MIX_PLUGIN: In order to view mix entry you must add the mix plugin to the uiconf xml
-
playerBgColor
Determine the background color of the player (the canvas behind the video player), set the value to a uint value representing an RGB color
Default: 0
-
playerBgAlpha
Determine the background alpha of the player (the canvas behind the video player)
Default: 1
Options:
- Float between 0 to 1. 0=transparent and 1=opaque
-
MediaProxy
The MediaProxy object is responsible for referencing and loading of the current playing media
-
mediaProxy.selectedFlavorId
The transcoding flavor currently playing. A valid id of a transcoding flavor associated with Kaltura entry currently being played
-
mediaProxy.preferedFlavorHeight
The prefered height for selecting the flavor to be played. This property is used when rtmp adaptive multi-bitrate is activated, -1 value will force an auto switching, other values will search for the transcoding flavor with the closest height. Any integer is acceptable
Default: -1
-
mediaProxy.imageDefaultDuration
In case of an Image media is played in a playlist this value will set the defualt time period that the image will hold untill the next image is presented. Any positive number representing seconds is acceptable
Default: 3
-
mediaProxy.supportImageDuration
This is used to turn an image to a timed image. It is useful in case of playlist where an image should only show for a specific time before the next item will show. If the image should show without time (static), turn this to false
Default: true in case of playlists, false in case of single image
-
mediaProxy.initialBufferTime
Set the initial buffer time in dual buffering method, when a number of seconds indicated by this parameter will be buffered, the stream playback will start and the buffer size will incrase to expandedBufferTime. Any positive number representing the number of seconds the buffer should hold before playback
Default: 2
Notes: See com.kaltura.osmf.buffering.DualThresholdBufferingProxyElement for more about Dual Threshold Buffering
-
mediaProxy.expandedBufferTime
Set the desired buffer time in dual buffering method, after the stream buffer has accumulated the number of seconds indicated by initialBufferTime the buffer size will incrase to the number of seconds indicated by this parameter to maximize the buffer download size during playback. Any positive number representing the desired seconds to buffer
Default: 10
Notes: See com.kaltura.osmf.buffering.DualThresholdBufferingProxyElement for more about Dual Threshold Buffering
-
KDP Components & Plugins
Using a standard OOP dot notation, every Kdp component and plugin attributes can be overrided via flashvars: objectId.parameter=value. For example, to set the playlist to load automatically pass the following flashvar: playlistAPI.autoPlay=true
The plugins avavilable in the base distribution:
- playlistAPI: The playlist dataProvider
- kalturaMix: Plugin responsible for rendering Kaltura remix sequences
- download: A media download button
- statistics: A plugin responsible for sending statistics data to the Kaltura server
- captureThumbnail: A button that when clicked capture a new thumbnail for the played Kaltura media entry
- plymedia: Adds PlyMedia subtitles functionality
- gigya: Adds Gigya social sites sharing functionality
- tremor: Adds Tremor ad network integratino
- adaptv: Adds AdapTv ad network integration
- tabBar: Horizontal Tab Bar compnent used by the multi-tab-playlist
- list: list of items (This plugin is used to build the playlist UI)
Example: Place the following flashvars to load an openx served ad inside a watermark as banner ad
flashvars.bannerad.watermarkClickPath='http://d1.openx.org/ck.php?n=a45b33cc'&
flashvars.bannerad.watermarkPath='http://d1.openx.org/avw.php?zoneid=110118&cb=22&n=a45b33cc'&
flashvars.bannerad.width=468&
flashvars.bannerad.height=60&
flashvars.bannerad.plugin=true&
flashvars.bannerad.position='firstChild'&
flashvars.bannerad.relativeTo='player'&
flashvars.bannerad.className='Watermark'&
-
pluginDomain
The url to load KDP plugins from, use in file system mode or to load the KDP plugins from path other the the host (The defaultVal is a folder relative to the KDP host)
Default: plugins/
-
componentId.className
Define a new component of type className by the id of 'componentId', a component is different from plugin in that it is pre-compiled inside Kdp and doesn't require to load an external swf file
-
pluginId.plugin
Define 'pluginId' as a new Kdp plugin to be loaded, the value doesn't matter, the existance of the plugin property defines an object as a Kdp plugin
Default: undefined
-
pluginId.path
The path to load the plugin swf file from, if undefined, the plugin will be loaded from a 'plugins' subfolder of the folder kdp was loaded from
Default: undefined
-
pluginId.relativeTo
The id of the component to add th plugin next to" options="An id of another Kdp component or plugin defined in the loaded uiConf
Default: If not defined, the plugin will be added as the first component in the Kdp display list
-
pluginId.position
The method to position the plugin or component in relative to the component defined by pluginId.relativeTo
Positions:
- before: Plugin will be added before pluginId.relativeTo
- after: Plugin will be added after pluginId.relativeTo
- firstChild: Plugin will be added as a child of pluginId.relativeTo and before all its other children
- lastChild: Plugin will be added as a child of pluginId.relativeTo and after all its other children
-
pluginId.{any additional attribute} = {value}
KDP enables passing of any parameters to the plugins using the dot syntax. Using this syntax, it is possible to set any additional attribute that are specific to the plugin
-
kdpReady
A javascript function on the hosting web page that will be called by KDP when the initial setup and init is completed - use this handler to identify when KDP is ready to be used by the hosting page, when setting sourceType=url use jsCallbackReady instead. The value should be the name of a function to be used as the handler in the hosting page
Default: undefined
-
externalInterfaceDisabled
Enable the JavaScript API
Default: true
Options:
- true: JavaScript APIs will be DISABLED
- false: JavaScript APIs will be Enabled
JavaScript APIs
Kdp provide a complete integration with it's hosting environment via externalInterface functions. Use jsCallbackReady to verify that the Kdp JavaScript apis are ready to be called
- Notifications: Notifications are both actions and events; (e.g. play and pause). To know when a notification was dispatched add a listener to the notification name using the addJsListener (e.g. addJsListener('play');) and to make Kdp perform an action dispatch the notification using sendNotification (e.g. sendNotification('play')); For a list of notifications see the Notifications leaf in this tree
- Attributes: At run-time any public Kdp parameter or object properties in Kdp can be retrieved or changed via JavaScript; use evaluate method to get the values of various attributes or object properties and use the setAttribute method to change it's value
-
jsCallbackReady
A javascript function on the hosting web page that will be called by KDP when setup of externalInterface APIs is completed. When setting sourceType=entryId, it is advised to use kdpReady instead of this event. Value should be the name of a function to be used as the handler in the hosting page
Default: undefined
-
addJsListener(listenerString:String, jsFunctionName:String)
Register a javascript handler function for a KDP notification
Parameters:
- listenerString: The name of the notification to listen to
- jsFunctionName: The name of the JavaScript handler function
-
removeJsListener(listenerString:String, jsFunctionName:String)
Remove a listener to KDP notofication
Parameters:
- listenerString: The name of the notification to listen to
- jsFunctionName: The name of the JavaScript handler function
-
sendNotification(notificationName:String, notificationData:Object)
Call a KDP notification (perform actions using this API, for example: play, pause, changeMedia, etc.)
Parameters:
- notificationName: The name of notification to call
- notificationData: the custom data to pass with the notification
BackgroundL&bnsp;
Notifications are both actions and events; DO notifications represent actions that will be carried by KDP and the rest are notification events that notify of occured change or performed action. To know when a notification was dispatched add a listener to the notification name using the addJsListener (e.g. addJsListener('play');) and to make Kdp perform an action dispatch the notification using sendNotification (e.g. sendNotification('play')). Some notification carry a data object with additional information about the action that was carried and all notification also pass the id of the player that dispatched the notification - this is useful for cases where JavaScript integration is created with more than single KDP on the same page
Notifications list
- STARTUP (startUp): the first command that register the main proxys and main view mediator
- DURATION_CHANGE (durationChange): Notify a change in the playing entry duration
- INITIATE_APP (initiatApp): Start the init macro commands
- CHANGE_MEDIA (changeMedia): Start the init of change media macro commands
- CLEAN_MEDIA (cleanMedia): cleans the media in case of change media and entryId== -1
- SKIN_LOADED (skinLoaded): Dispatched when the skin is loaded
- SKIN_LOAD_FAILED (skinLoadFailed): Skin load failed
- ENTRY_READY (entryReady): The Entry is set
- ENTRY_FAILED (entryFailed): Get Entry failed
- SOURCE_READY (sourceReady): When the source is ready we can set the media element to the media player
- LOAD_MEDIA (loadMedia): Start the init macro command of the KDP
- MEDIA_LOADING (mediaLoading): The loadable media has begun loading
- MEDIA_READY (mediaReady): The loadable media has completed loading
- MEDIA_UNLOADED (mediaUnloaded): The loadable media has begun unloading
- MEDIA_LOAD_ERROR (mediaLoadError): The loadable media has failed to complete loading
- MEDIA_ERROR (mediaError): The playe notify on media error
- ROOT_RESIZE (rootResize): The playe parent was resized
- MEDIA_VIEWABLE_CHANGE (mediaViewableChange): Used mainlly to know when OSMF Media Playe is viewable
- PRE_1_START (pre1start): This is the first event that start the pre sequence
- POST_1_START (post1start): This is the first event that start the pro sequence
- DO_PAUSE (doPause): Command the player to pause
- DO_PLAY (doPlay): Command the player to play
- DO_PLAY_ENTRY (doPlayEntry): This is the actually play command on the video player. It is an addition to the DoPlay because of the pre session mechanism (pre
- roll ads; bumper)
- DO_STOP (doStop): Do stop command to the kplayer. Pause and move the playhead to 0
- DO_SEEK (doSeek): Do seek command to the kplayer. Addition data - number
- DO_INTELLIGENT_SEEK (doIntelligentSeek): Do seek command but with INTELLINGENT SEEK
- DO_SWITCH (doSwitch): Do switch command for switching manual switching between mbr streams within an rtmp dynamic stream resource
- KDP_READY (kdpReady): Notify that the application is ready to be used and events can be listened to and that the loaded entry is ready to be played
- KDP_EMPTY (kdpEmpty): Notify that the application is ready to be used and events can be listened to
but no media was loaded
- LAYOUT_READY (layoutReady): Dispahed when the init macro command is done and the layout is ready
- PLAYER_STATE_CHANGE (playerStateChange): The player is loading or connecting to the media
- PLAYER_READY (playerReady): Dispatches when the player is ready to play the media
- PLAYER_CONTAINER_READY (playerContainerReady): When the player mediator finish to register we can reffer to the player container from anywhere
- PLAYER_PAUSED (playerPaused): The player is now in pause state
- PLAYER_PLAYED (playerPlayed): The player is now in play state
- PLAYER_SEEK_START (playerSeekStart): Notify about a seek activity that started
- PLAYER_SEEK_END (playerSeekEnd): Notify that the seek activity has finished
- PLAYER_PLAY_END (playerPlayEnd): The played media has reached the end of playback
- PLAYER_UPDATE_PLAYHEAD (playerUpdatePlayhead): An update event that notify about the progress in time when playback is running
- PLAYER_DIMENSION_CHANGE (playerDimensionChange): Dispatched when the player width and/or height properties have changed
- OPEN_FULL_SCREEN (openFullScreen): Player entered full screen mdoe
- CLOSE_FULL_SCREEN (closeFullScreen): Player exited from full screen mode
- CHANGE_VOLUME (changeVolume): An action to change the volume
- VOLUME_CHANGED (volumeChanged): Notification about a change in the player volume
- ENABLE_GUI (enableGui): Enable/disable gui. Addition data - Boolean
- FAST_FORWARD (fastForward): Fast forward the player. Addition data - times X (X2; X8; X4)
- STOP_FAST_FORWARD (stopFastForward): Fast forward the player. Addition data - times X (X2; X8; X4)
- BYTES_DOWNLOADED_CHANGE (bytesDownloadedChange): Notify the current and the previous value of bytesDownloaded
- BYTES_TOTAL_CHANGE (bytesTotalChange): Dispatched by the player when the value of the property 'bytesTotal' has changed
- BUFFER_PROGRESS (bufferProgress): Dispatches when progress of player in case of image or video
- BUFFER_CHANGE (bufferChange): Dispatches when the player start or stop buffering
- PLAYER_DOWNLOAD_COMPLETE (playerDownloadComplete): Dispatched to notify of media download complete
- END_ENTRY_SESSION (endEntrySession): The end of entry session (with ads and/or extra content)
- END_PRE_SESSION (endPreSession): The end of pre entry session (the session that happens before the actual video playing)
- END_POST_SESSION (endPostSession): The end of post entry session (the session that happens after the actual video playing)
- DURATION_CHANGE (durationChange): The player dispatches this event when its duration property has changed
- HAS_CLOSED_FULL_SCREEN (hasCloseFullScreen): The fullscreen has just closed
- HAS_OPENED_FULL_SCREEN (hasOpenedFullScreen): The fullscreen was just activated
- SWITCHING_CHANGE (switchingChange): The transcoding flavor was changed dynamically according to the user connection
- SCRUBBER_DRAG_START (scrubberDragStart): The scrubber had started being dragged
- SCRUBBER_DRAG_END (scrubberDragEnd): The scrubber had stopped being dragged
- ALERT (alert): Pop up an alert. String arguments; message and title
- SHOW_UI_ELEMENT (showUiElement): Show/hide an element fron the layout. arguments id-String and show-boolean
- CANCEL_ALERTS (cancelAlerts): Hide Alerts at the Alerts Mediator
- ENABLE_ALERTS (enableAlerts): Show Alerts at the Alerts Mediator
- FREE_PREVIEW_END (freePreviewEnd): A notification that will be called on the hosting page with content that should be purchased after a short preview
Notes: Note that this list include the notifications that are deployed in default Kdp compilation. Notifications that are defined by plugins are not listed here - Refer to the plugins documentation for a list of notifications a specific plugin define
evaluate(expression:String)
Retrieve the value of a KDP model property or component's property (using the standard OOP dot notation inside curly brackets, for example to get the name of the playing media entry use: evaluate('{mediaProxy.entry.name}')), it is possible using the evaluate function to retrieve any uiconf element by it's id
setAttribute
Change a value of a KDP model property or component's property (using the standard OOP dot notation, for example to change the name of the playing media entry use: setAttribute('mediaProxy.entry', 'name', 'new entry name'))
Parameters:
- componentName: The name of the object whos property to change
- prop: The name of the property to change,newValue:The new value to set
KDP Expressions
KDP enables various methods for evaluating expressions in run-time, review this section to laern how to use expressions in KDP
-
Expression types
There are two types of evaluations carried by KDP, simple parsing of strings and bindings
-
Simple Expressions
Simple expressions are constant strings that will be read by KDP as is - no interpretation will be made when using simple expressions
Options: Any text string is valid; for exmaple: 'The Kaltura Player is AWESOME and seXy!
-
Binding Expressions
Bindings are strings wrapped inside curly braces that will be evaluated during run-time and 'magically' updated whenever the value of th expression is changed
Examples:
- Layout bindings: Set a label to show the name of the playing media; <Label text='{mediaProxy.entry.name}' />
- Layout binding: Expressions may include both constant and binding: <Label text="Name - {mediaProxy.entry.name}" />
Notes: When evaluating a binding expression as an action notification argument or when requesed via the evaluate() function the values are not binded but just evaluted at the time of the call. This feature is utilizing the binding mechanism of the Adobe Flex framework (extracted from the Flex SDK version 3)
-
itemRenderers scope
When expressions are used within an item renderer such as a playlist item, use the 'this' keyword to instruct the KDP to retrieve the attribute of the item's data provider
Example: Showing the name and thumbnail of a playlist item:<Label text="{this.name}" /><Image url="{this.thumbnailUrl}" />
-
Global helper functions in expressions
Expressions may include calls to internal KDP functions, there are few global helper functions to ease common tasks such as formatting or opening a url
Notes: The functions are action script functions written under the FuncsProxy class. A function can be written specifically inside the data provider by specfiying an _owner property under the data provider that will point to an object containing the function
-
formatDate(dateObject:*, format:String):String
Format a date or time using a format string. Available Time Formats: MM:SS and HH:MM:SS, date formats: DD/MM/YYYY
Example: A label that shows the media duration:<Label text="{formatDate(this.duration, 'MM:SS')}" />
-
navigate(url:String, window:String = null):void
Call the default browser and open a url on a specified target window
Example: Open kaltura.com website when clicking on a button:<Button kClick="navigate(http://www.kaltura.com)" />
-
jsCall(...args):void
jsCall is used to call a Javascript functions on the hosting page. Through jsCall, JS functions can be defined within the layout configuration xml under the 'javaScript' node. Each function is declared as an xml node with the id of the defined function. The contents of the node is a CDATA section with the javascript code. When the function is called the code within the CDATA section is concatenated with the call request and evaluated using the eval javascript function
Example: Call a javascript alert showing the name of the playing media entry:<Button kClick="jsCall(alert, {mediaProxy.entry.name})" />
Layout - uiConf / KML
The KDP provides an mxml like UI language to enable building various KDP instances by injecting an XML file that define the various components and plugins that will be loaded and instantiated, as well as a SWF file that contains the actual elements design.
The uiConf also define the interaction between the user, the UI elements and the played media.
-
The layout sections
The uiConf defines the KDP layout and UI elements using the following sections:
- layout
- screens
- renderers
- strings
- plugins
- uiVars
- javaScript
- extraData
-
Layout components
The uiConf define various types of components that can be used to build the player UI, the following is a list of the most common components and plugins
- Video - The MediaPlayer, this is a chromeless component that plays the loaded media
(com.kaltura.kdpfl.view.media.KMediaPlayer)
- Button - A regular 4 states button
(com.kaltura.kdpfl.view.controls.KButton)
- VBox - The VBox container lays out its children in a single vertical column
(com.kaltura.kdpfl.view.containers.KVBox)
- HBox - The HBox container lays out its children in a single horizontal row
(com.kaltura.kdpfl.view.containers.KHBox)
- Canvas - A Canvas layout container defines a rectangular region in which you place child containers and controls. Unlike all other components, the Canvas container does not lay out its child controls automatically. You must use absolute layout to position child components. With absolute layout you specify the x and y positions of the children
(com.kaltura.kdpfl.view.containers.KCanvas)
- Tile - A Tile layout container lays out its children in one or more vertical columns or horizontal rows, starting new rows or columns as necessary. The direction in which the layout of the children is ordered is from left to right
(com.kaltura.kdpfl.view.containers.KTile)
- Scrubber - An horizontal slider component used to seek (navigate) the played media time. The scrubber has inside of it a progress bar that shows the loading progress of the played media
(com.kaltura.kdpfl.view.controls.KScrubber)
- VolumeBar - A vertical slider component that controls the played media volume
(com.kaltura.kdpfl.view.controls.KVolumeBar)
- Label - The Label control displays a single line of noneditable text
(com.kaltura.kdpfl.view.controls.KLabel)
- Timer - A label that shows the current playback time and the duration of the playing media
(com.kaltura.kdpfl.view.controls.KTimer)
- Screens - The screens element is a container that holds one or more uiConf XML elements to describe a visual screen. The logic of this screen is similar to the uiConf logic. The top element of a screen must be a container. Each screen must have a unique "id" attribute so it could be referenced
(com.kaltura.kdpfl.view.controls.Screens)
- Image - The Image control lets you import JPEG, PNG, GIF, and SWF files at runtime
(com.kaltura.kdpfl.view.media.KThumbnail)
- Watermark - The Watermark component is an image component that enables provide a click url capability. Use it to show an image that when clicked will navigate the browser to a url of your choice
(com.kaltura.kdpfl.view.controls.Watermark)
- Spacer - A whitespace component used to reserve empty spaces
(fl.core.UIComponent)
- FlavorCombo - A ComboBox (dropdown list) component that shows the transcoding flavors (content qualities) that the playing Kaltura Entry is available at. When your entries are available in various qualities, this component will enable your users to select the playback quality that will be most suitable for their connection speed. For automatic switching between quality, use the dynamic bitrate streaming from the KMC
(com.kaltura.kdpfl.view.controls.KFlavorComboBox)
-
Replace strings
Override flashvars strings with the strings located under the <Strings> node.
The strings will be overriden as strings.{string name}={value}
-
Replace flashvars
Override flashvars variables with the ones located under the node. The variables will be overriden as strings.{string name}={value}. The overrideFlashvar attribute controls whether an existing flashvar will be overriden
-
Add partner data variables from retrieved widget
When a KDP widget is shared, a new widget object is created. The new widget may contain data that should follow the widget. An example could be a widget that needs to point back to the page it was shared from. The integrator would create a flashvars such as homeUrl="....." and will set it when the html page loads. When the widget is shared a special flashvar variable named 'pd' holds a comma separated lists of flashvars that need to be passed on to the newly created widget. In the above example the one should set pd=homeUrl. When the kdp will request the new widget from Kaltura servers it will receive the homeUrl parameter. A custom button on the player can then navigate to url pointed by the homeUrl variable.
-
KDP will convert all flashvars to objects at run-time
All dotted flashvars, like watermark.path, will automatically turn to objects. e.g. watermark.path will turn to an object named watermark with a property named path
-
Adding KDP Plugins in the uiConf
KDP plugins can be defined and positioned inside the uiConf.
The path attribute is optional if the plugin is a Kaltura plugin which is hosted with the KDP under the plugins folder.
An optional className attribute can be provided in order to create builtin components (e.g. className="button" or className="label")