Docs | Common
PlayKit Basics for OVP Apps
On this page:
- Player interface
- PlayKit Manager
- Data objects
- Sample code
- Additional topics
The methods/properties names sometimes differ between iOS and Android due to platform naming conventions.
- prepare(): takes a PKMediaEntry objects and make it ready for playback
- play(): start playing the prepared media. If called before the media is ready to play, playback will start when ready.
- pause(): temporarily pause playback
- stop(): stop playback (release resources of current media)
- seek(): seek to a position
- destroy(): release all player resources
- addObserver()/addListener(): add listener to the player’s events.
The player sends events to the application. The primary events are:
- canPlay: the player has loaded the media and is ready to play
- durationChanged: the media’s duration is known or has changed
- ended: playback of current media is complete
- play: play was requested
- playing: playback has started
- pause: pause was requested
- seeking: the player started seeking
- seeked: seeking has finished
- stateChanged: the player state has changed
At all times the player is in a given state:
- idle: no media loaded (yet)
- ready: ready to play
- buffering: not playing because media is loading
- ended: media playback is complete
Static/singleton class used to load a new Player instance.
- loadPlayer(): create a new player instance
- registerPlugin(): register a player plugin
PlayKit has a built-in plugin system. All plugins implement a PKPlugin interface. The application is responsible for registering them (once, before starting the player for the first time) and setting/updating their configuration.
Kava is Kaltura’s Advanced Video Analytics service. We provide this plugin with sample code.
There are other analytics plugins, as well as a plugin for displaying video ads.
PKMediaEntry holds the information of a specific entry with all of its available sources, ready to be sent to the player. It contains a list of PKMediaSource objects.
PKMediaSource holds the URL and optionally other information required for playback.
OVP Starter shows how to use the built-in OVP media providers to load media info from Kaltura API, load a player with Kava plugin, and connect a basic UI.
|Casting||Guide :: Sample||Guide :: Sample|
|Track Selection||Guide :: Sample||Guide :: Sample|