Player Documentation

Getting started

As well as embedding the player directly from the dashboard you can use our JS player plugin to display media on your site. The plugin also gives you greater control over the player and allows interaction with elements on the page. To use the player plugin you will need to add the script reference below to any pages of your site that require the player:

Uncompressed
<script src="http://static.kenseimedia.com/js/kenseiplayer.js"></script>
Minified
<script src="http://static.kenseimedia.com/js/kenseiplayer.min.js"></script>
Note: This version of the plugin (with no version number) will always be kept upto date and will contain the latest version of the js code. For specific versions see the release sections below.

Download

If you would like to host the player plugin yourself instead of referencing the version from our CDN you can download it here: Uncompressed or Minified


Configuration

When you have included kenseiplayer.js in your page, you have the kensei.createPlayer() function available.

A player is created by calling kensei.createPlayer() with the required configuration data.

The configuration can be specified using a json object.

Required Configuration Properties

  • container: The ID of the element that will contain the player.
  • mediaItem:A mediaItem object from the kensei media api.
  • settings: A player settings object from the kensi media api.

Example showing only required config properties:

kensei.createPlayer({
	container: 'playerContainerId',
	mediaItem: mediaItemObject,
	settings: settingsObject
});
				

Optional Configuration Properties

  • playerURL: Specify the player swf URL.
  • skinURL: Specify the skin swf URL.
  • width: Width in pixels of the embedded player (default is 640).
  • height: Height in pixels of the embedded player (default is 360).
  • videoReady: Function which will be called when the video is ready to play.

Example showing all configuration properties:

kensei.createPlayer({
	container: 'playerContainerId',
	mediaItem: mediaItemObject,
	settings: settingsObject
	playerURL: '/player.swf',
	skinURL: '/skin.swf',
	videoReady: videoReadyHandler,
	width: 1024,
	height: 768
});
				

Player API

The kensei.createPlayer() method returns a kenseiplayer object which provides an interface to control playback.


kensiplayer object methods

  • play(): Start or resume playback of the current video.
  • pause(): Pause playback of the current video.
  • setMediaItem(): Set a new mediaItem (video or audio) for the player to load.
  • setSettings(): Set a new settings object. This will cause the player to re-rende

Example showing creating a player, playing the video when it is ready and then pausing the video after 3 seconds:

var player;

function onVideoReady() {
	player.play();

	setTimeout(function () {
	player.pause();
	}, 3000);
}

player = kensei.createPlayer({
	container: 'playerContainerId',
	mediaItem: mediaItemObject,
	settings: settingsObject,
	videoReady: onVideoReady
});
				

Demo

View a demo of the player plugin in action here


Current Release

v1.8.5 - Uncompressed or Minified

  • Fixed issue with HTML5 player display logic
  • Images now come from CDN

Uncompressed
<script src="http://static.kenseimedia.com/js/kenseiplayer-1.8.5.js"></script>
Minified
<script src="http://static.kenseimedia.com/js/kenseiplayer-1.8.5.min.js"></script>

Past Releases

v1.8 - Uncompressed or Minified

Uncompressed
<script src="http://static.kenseimedia.com/js/kenseiplayer-1.8.js"></script>
Minified
<script src="http://static.kenseimedia.com/js/kenseiplayer-1.8.min.js"></script>