Video ready callback

Hi all,

I am uploading a video through PHP API, but I don’t know when the video is ready for view, so the user cannot view yet the video.

Is there any kind of callback(url call) when the video conversion is ready or video is ready for view?


Hello @mappsvid,

There are two ways you can go about this:

  1. Once the upload process concludes, call baseEntry->get() and ensure the status member of the returned object is set to 2 [READY] and, if not, sleep for a while and check again. That’s okay for short [small] source videos but can become inefficient with longer [bigger] sources.

  2. Use the event notifications mechanism to trigger an alert once the entry is ready for playback.
    To learn more about how this mechanism works, see

Below is a full example for setting up such a notification using the Ruby client, but the same can be done using all the other Kaltura API clients and the tutorial above includes a code generator that can save you a lot of time and effort:

require 'kaltura'
include Kaltura

if ARGV.length < 6
    puts "Usage: " + __FILE__ + " <partner ID> <admin secret> <service URL> <target URL> <web server basic auth username> <web server basic auth passwd>"
      exit 1

partner_id = ARGV[0]
admin_secret  = ARGV[1]
target_url = ARGV[3]
target_username = ARGV[4]
target_passwd = ARGV[5]

config =
config.service_url = ARGV[2]
client =;
client.ks = client.session_service.start(

filter =
filter.type_equal = KalturaEventNotificationTemplateType::HTTP
filter.system_name_equal = 'HTTP_ENTRY_STATUS_EQUALS'
pager =

  results = client.event_notification_template_service.list_templates(filter, pager)
  notification_template_id = results.objects[0].id
rescue Kaltura::KalturaAPIError => e
  puts(__LINE__.to_s + ": Exception Class: #{}")
  puts(__LINE__.to_s + ": Exception Message: #{e.message}")

  event_notification_template =
  clone_results = client.event_notification_template_service.clone(notification_template_id, event_notification_template)
  new_notification_id =
  event_notification_template =
  event_notification_template.url = target_url
  event_notification_template.method = KalturaHttpNotificationMethod::POST =
  event_notification_template.authentication_method = KalturaHttpNotificationAuthenticationMethod::BASIC
  event_notification_template.password = target_passwd
  event_notification_template.username = target_username

    results = client.event_notification_template_service.update(new_notification_id, event_notification_template)
    client.event_notification_template_service.update_status(, KalturaEventNotificationTemplateStatus::ACTIVE)
  rescue Kaltura::KalturaAPIError => e
    puts("Exception Class: #{}")
    puts("Exception Message: #{e.message}")

  puts "New notification event ID: " +
rescue Kaltura::KalturaAPIError => e
  puts(__LINE__.to_s + ": Exception Class: #{}")
  puts(__LINE__.to_s + ": Exception Message: #{e.message}")

Great! Thanks, I’ll have a look!