KDP basic usage - embedding on HTML pages and Playback

Introduction

This guide will show you how to embed the Kaltura Player and how to play a demo video hosted on Kaltura’s servers.

Prerequisites

  • Kaltura Partner ID.
  • – An easy method to embed Flash content using JavaScript.

Using SWFObject 2

We highly recommend using SWFObject 2 when dealing with Flash content.
It makes the developer's life easier by ignoring cross browser issues related to the classic Flash embed methods and adds extra features like Flash version detection and the option to use Adobe Express Install to download the latest Flash Player.
This guide is not intended to be a detailed explanation of SWFObject, it is meant to show a simple method of using it.

Player URL

When you apply for a Kaltura Partner ID, the system automatically creates a basic player for you.
This player is located at the following URL:
http://www.kaltura.com/kwidget/wid/_{PARTNERID}
Where {PARTNERID} should be replaced with your unique Partner ID (without the parentheses).
For example, the URL for Partner ID 123 is:
http://www.kaltura.com/kwidget/wid/_123

To use a custom player created with the Kaltura Application Studio (a part of the Kaltura Management Console) all you need to do is to add the 'ui_conf_id' parameter to the player URL together with the new player configuration you just created.
If you new player configuration ID is 1234567, your custom player URL would be -
http://www.kaltura.com/kwidget/wid/_123/ui_conf_id/1234567
Please note that this is optional and if you don't pass the ui_conf_id a basic player will load.

Player Configuration

To tell the player what media entry to play, a FlashVar named entryId should be passed to the player when embedding it.
We will use an example video with the id "hsgxym7h34".
Note that advanced player configurations are outside the scope of this guide, here we will only configure our player to play a specific media entry.

Embed Your Player

  • Include the SWFObject JavaScript file (Make sure you are using SWFObject 2):
    <script type="text/javascript" src="swfobject.js"></script>
  • Add the following code to your HTML page:
    <div id="kplayer"></div>
    <script type="text/javascript">
            var params = {
                    allowscriptaccess: "always",
                    allownetworking: "all",
                    allowfullscreen: "true",
                    wmode: "opaque"
            };
            var flashVars = {
                    entryId: "hsgxym7h34"
            };
            swfobject.embedSWF("http://www.kaltura.com/kwidget/wid/_{PARTNERID}/ui_conf_id/{PLAYER_CONFIGURATION}", "kplayer", "400", "360", "9.0.0", false, flashVars, params);
    </script>
  • {PARTNERID} should be replaced with your Patner ID (removing the parentheses).
  • "hsgxym7h34" is the entry id being played.

PHP integration, KDP Embedding template

For more dynamic environments, it is common to create a php script that will generate KDP embed codes from a template. The following lines explain the kdp-template.php file.

The kdp-template.php file is a template that uses both swfObject and uiQuery.
swfObject is being used to easily embed the flash widget while having cross-browser compatibility.
jQuery is used to make calls via javascript to control the player using HTML buttons.

The kdp-template.php script provides an easy interface to control the embedding via php parameters. The following list describes these parameters.

  • player_width = 320; - The width the player will be shown
  • player_height = 240; - The width the player will be shown
  • widgetid = "_1"; - Represents a set of details about a specific player instance (default to '_'+partnerId)
  • uiConfId = "1000106"; - UICONF ID - A SPECIFIC PLAYER DESIGN TO USE (DEFAULT IS HOSTED EDITION CHROMELESS PLAYER)
  • entryid = "921594"; - ENTRY ID TO PLAYBACK OR STATIC PROGRESSIVE FILE URL
  • host = "www.kaltura.com"; - THE URL TO THE KALTURA SERVER
  • debugmode = "0"; - DEBUGGING OF PLUGINS - SHOULD NOT BE USED UNLESS DEBUGGING OF LOCAL TRANSITIONS/OVERLAYS/EFFECTS
  • autoPlay = "0"; - BOOLEAN FOR AUTOPLAY
  • bufferTime = "5"; - TIME IN SECONDS TO BUFFER - ONLY USED FOR
  • downloadBeforePlay = "0"; - INSTRUCT THAT NO PLAYBACK SHOULD BE AVAILABLE BEFORE THE WHOLE FILE HAS BEEN DOWNLOADED
  • disableUrlHashing = "1"; - INDICATE THAT NO DYNAMIC SUB-DOMAINS SHOULD BE USED
  • localUiFunc = ""; - FOR DEBUGGING OF LOCAL (IN-PAGE) UICONF XML
  • seekFromStart = "120000"; - PERFORM SEEK WHEN PLAYER START PLAYBACK, IN MILLISECONDS
  • The following only apply for when streaming via media server (fms/red5...):
    • streamer = ''; - URL TO STREAMING SERVER AND APPLICATION
    • streamerType = ''; - STREAMING FILE TYPE (MP4/FLV...)
    • streamerFile = ''; - DOES ENTRY ID INDICATES OF A STATIC STREAMING FILE URL OR KALTURA ENTRY ID

Embedding KDP - PHP Sample kits

AttachmentSize
kdp-template.tgz1.78 KB
kdp-sample-kit.tgz3.52 MB

Comments

This page is out of date.

You can't swap uiConf ID's anymore as it appears you use hashes to secure the binding between content and config.