Adobe OSMF is the Open Source Media Framework on which Kaltura's Flash Player, aka KDP3 is based of. This article explains how to prepare native OSMF plugins to be loaded by KDP3. To learn more about KDP Plugins and how to create custom KDP plugins see: How to Create KDP Plugins.
To add the OSMF plugin, use the GenericOSMFPlugin which is a KDP-plugin used to load the OSMF plugin.
You can add the genericOSMF plugin to a player in one the following ways:
Add a genericOSMF plugin into the uiconf XML (adds an XML node to the uiConf XML).
The configuration of the player (the uiconf) holds the genericOSMF plugin and also contains the path to the OSMF swf file (the OSMF plugin)
- Add a genericOSMF plugin via flashvars. The embedded player does not have the genericOSMF by default and is loaded per specific embed code.
This article describes how to implement both ways, however you will need to decide what your preferred method is according to your business case's needs.
Adding the next XML node to the player, at the top part of it (where most of the non-visual plugins are located) makes the player load the genericOSMF plugin that loads the OSMF plugin from http://www.whatever.com/plugins/myOsmfPlugin.swf
<Plugin id="genericOSMF" width="0" height="0" loadingPolicy="preInitialize" asyncInit="true" pluginURL="http://www.whatever.com/plugins/myOsmfPlugin.swf" />
The plugin does not require width and height values, so they are set to 0. The plugin should load at the inital loading phase of the player and have the player wait for the plugin to register the OSMF code. When the initial content is played using the OSMF plugin, the asyncInit and loadingPolicy should be set with their according values.
The folowing flashvars string is the equivalent of placing the XML node described above, right after the statistics plugin.
The KDP has a mechanism that knows how to 'inject' an XML node to the uiconf XML configuration from flashvars. There are 2 additional attributes that control the position of these node injections. Other than these attributes all the other attributes are the same and use the sytax described to implement adding the plugin.
After making sure that the OSMF plugin is loaded into the player you should provide content to play. We reccomment integration with Kaltura, so that Kaltura entries return files that will be played through the plugin, or with a direct URL assignment. This article shows how to pass a URL to the player and does not describe the integration process,
Set up the Video URL
After you set up the plugin you will need to load the video URL to the player. Usually this happens automatically when you grab an embed code from the KMC, however, using these processes you will need to inject the video URL directly to the player by detaching the Kaltura entry id (if it is in the embed code). This action is different for the different embed types:
- For legacy embed – find the URL for the player and remove the /entry_id/XXXXX from it.
For example, if the url for the player is:
change it to:
wherever the URL appears in the embed.
- For dynamic embed – delete the entry_id parameter from the configuration and remove the comma behind (if necessary).
For example: remove the following line from a grabbed dynamic embed:
Now, that the player has no content, you can add the URL using two additional flashvars. One flashvar notifies the player that the video should come from an external URL instead of a Kaltura Entry, and the other flashvar points to the actual URL.
The following example shows how to add the plugin with flashvars with legacy embed and dynamic embed: