The Phoenix Media Provider allows an app to easily get Media Entries from the Kaltura Phoenix backend. The app just provides the required parameters and the provider fetches a MediaEntry object ready for use with the player.


Android (Java)

  // Create a session provider
  final SimpleSessionProvider sessionProvider = new SimpleSessionProvider(BASE_SERVER_URL, PARTNER_ID, KS);

  // Create the media provider
  final PhoenixMediaProvider phoenixMediaProvider = new PhoenixMediaProvider()
          .setAssetId(ASSET_ID) // Required

  // Load the media
  phoenixMediaProvider.load(new OnMediaLoadCompletion() {
    public void onComplete(final ResultElement<PKMediaEntry> response) {
      runOnUiThread(new Runnable() {
        public void run() {
          if (response.getResponse() != null) {
            final PKMediaConfig mediaConfig = new PKMediaConfig().setMediaEntry(response.getResponse());

iOS (Swift)

  // Create a session provider
  let sessionProvider = SimpleOVPSessionProvider(serverURL: BASE_SERVER_URL,
                                                 partnerId: PARTNER_ID,
                                                 ks: KS)

  // Create the media provider
  let phoenixMediaProvider = PhoenixMediaProvider()
      .set(assetId: ASSET_ID)
      .set(type: ASSET_TYPE)
      .set(playbackContextType: PLAYBACK_CONTEXT_TYPE)
      .set(formats: FORMAT_LIST)
      .set(fileIds: FILE_ID_LIST)
      .set(referrer: REFERRER)
      .set(sessionProvider: sessionProvider)
  // Load the media
  phoenixMediaProvider.loadMedia { (pkMediaEntry.set(refType: .media), error) in
      guard let mediaEntry = pkMediaEntry else { return }

      // Create media config
      let mediaConfig = MediaConfig(mediaEntry: mediaEntry)

      // Prepare the player

Required Arguments

Optional Arguments

Fine-grained Media Selection Arguments

Type Arguments

ASSET_TYPE and PLAYBACK_CONTEXT_TYPE depend on the requested use case.

The following are the valid argument combinations:

Linear Media Playback
VOD Media Playback/Trailer
StartOver EPG StartOver
Catchup EPG Catchup
Recording Recording Playback

To simplify application code, the provider selects the following defaults:

  1. If PLAYBACK_CONTEXT_TYPE is not selected, set it to Playback
  2. If ASSET_TYPE is not selected:
    • If PLAYBACK_CONTEXT_TYPE is Playback or Trailer, set ASSET_TYPE to Media
    • If PLAYBACK_CONTEXT_TYPE is StartOver or Catchup, set ASSET_TYPE to EPG

As a result, it’s normally enough to just specify PLAYBACK_CONTEXT_TYPE. Recording is the exception.

Note: in special situations an app may also have to set an additional field, assetReferenceType. It should only be used if instructed by Kaltura.