/ng-kaltura-player

Kaltura player directive for AngularJS

Primary LanguageJavaScript

ng-kaltura-player

Overview

A directive for AngularJS for embedding the Kaltura video player.
The directive supports basic embedding as well an API for controlling the player using notifications and events registration.
Player plugins can be configured as well.

Setup

  1. Download the directive file: ng-kaltura-player.js and add it to your HTML page:
<script src="ng-kaltura-player.js"></script>
  1. Inject the 'Kaltura.directives' namespace to your Angular application:
angular.module('App', ['Kaltura.directives'])
  1. Use the directive in your HTML markup:
<kaltura-player width="640px" height="320px"></kaltura-player>
  1. Explore the examples below to learn how to configure the player and use its API

Usage

Attributes

  • width: The player width. You can specify px for pixels or % for percentage
  • height: The player height. You can specify px for pixels or % for percentage
  • pid: Your Kaltura publisher ID.
  • uiconfid: Your Kaltura player ID.
  • entryid: The entry ID of the video to play.
  • flahvars: A Kaltura player flashvars object listing player configuration and plugins.

Events

  • kalturaPlayerReady: Dispatched by the directive to the $rootScope when the Kaltura player is ready to play:
	$scope.$on("kalturaPlayerReady", function(event, kdp, id){
		// event: the event object
		// kdp: A reference to the Kaltura player that can be used with the Kaltura player API.
		// id: the player directive id attribute if specified.
	});

Examples