The Kaltura Applications Framework, or KAF as we call it around here, is a configurable set of iFrame views that streamlines the integration of common media capabilites and workflows that are part of the Kaltura platform. Contained are a set of embeddable media tools that developers can embed in their applications with minimal code, accelelerating the time to market for media-centric application workflows. KAF also supports the LTI standard that simplifies integration into learning management systems.
We’ve created a sample application that will help showcase the various functionalities of KAF.
Things you’ll need in order to run the sample code:
- First and foremost your
Kaltura Instance URL, which you’ll receive with your KAF account. Send us an email at [email protected] to sign up for an account.
Kaltura Partner ID and
Admin Secret, which can be found under Integration Settings in the Kaltura Management Console.
UI Conf ID (or player ID) that will be used for embedding the video player in the webpage. The ID for each player can be found under Studio in the KMC.
Be sure to set these variables in the kaltura_config file of the sample code. Other things you’ll find in the config:
Domain where the sample code is being hosted – change this accordingly.
Kaltura Service URL – which should stay as is unless you’ve been informed otherwise.
generateSession function which creates a Kaltura Session using the Kaltura PHP Client Library. This KS will be included in calls made to the KAF endpoint, in order to authenticate and determine privileges.
A word about privileges: every action done in KAF requires a KS (Kaltura Session). Each KS is created with a
privilegesstringa and a user ID, which in most cases is an email address but can technically be any string, and essentially represents the unique user who is currently logged in to your application. The privilege string represents the user’s role, what he/she will have access to, as well as other security options. We will cover the KAF specific privileges below in the context of each KAF view.
Now let’s discuss the various iFrames and parts of the sample code.
This is like a personalized media locker for end users where they can upload assets and manage videos and other media files. Behind the scenes, the code generates a kaltura session using the user ID and given privileges for the user and loads the relevant media in a responsive iFrame, which is similar to what you may have seen in mediaspace.
Simply put, a collection is a category of content that contains entries from the application owner’s account. A category has options for metadata, as well as settings for various levels of moderation. The hosting application determines which level of permissions each user has in the collection. In our sample code, the collection name can be modified via the url, along with the user ID and roles. This makes it easy to see what will be displayed in the case of varying users with varying content and permissions.
The Browse, Search and Embed iFrame (BSE), a key component of KAF, is used for the sole purpose of selecting content from the user’s own “my media” library or shared repository that is enabled in the KAF instance that the user is given access to. The BSE view may be used for a variety of apllicative use cases. Our sample application shows a few such scenarios.
The Video Landing Page
This use case describes giving users a tool to choose a video for the placeholder in a landing page template. Upon selection of the entry, it is embedded as a kaltura player in the landing page, and the template need only remember the entry ID in order to load that same video when rendering the page.
What’s happening behind the scenes? When the entry is chosen, the Kaltura BSE url is called with a suitable Kaltura session. When that session was originally generated, the return url containing the handler for this specific landing page template (in this case ‘handle_selected_media.php’) was declared in the privilege string with which the KS was created. That handler receives a url from KAF and saves it to a file database with the entry ID. That way, when the landing page is loaded by a user, a given entry ID maps to the url of the iFrame containing the relevant video player. A new KS is generated each time and added to that KAF url.
Thumbnail Selection for Emails
Here we show a scenario of providing users a tool to pick a frame from a video that will used as a thumbnail in an email. Generally, that email would link to the landing page we discussed above where the video actually lives. Similar to the video picker above, the BSE url is called with a kaltura session containing information about the return url. In this case however, it calls the Kaltura Thumbnail API with the entry ID and the moment in the video from which to grab the thumbnail. The image from the returned url is then placed in the email.
This functionality echoes the others we’ve mentioned above, with more of a DIY approach. It will allow users to grab the embed codes for specific media assets, in order to embed in their own pages. Keep in mind that while it’s easy to use this iFrame as a standalone and implement that embed code wherever it’s needed, you might be forfeiting KAF environment functionalities like player analytics.
Similar to the grabbbable embed, but this time for a product image tag. In this case, however, the metedata of the selected entry is packaged as an object, which is easier to send around. The object, as can be seen in
handle_selected_product.php is made up of embed data like the title, description, tags and duration of the entry. You can learn more the schema here.
While you can get really creative with the Browse, Search and Embed functionality, the use cases in the sample code should provide a pretty good picture of all that can be done with KAF. You can see from the few workflows just how easy and simple it is to power any application with media selection scenarios and implement a whole set of robust capabilities… with just a couple lines of code.
Want to dive deeper into the Kaltura Applications Framework? Check out the sample application.