Copyright © 2012 Kaltura Inc.
All Rights Reserved. Designated trademarks and brands are the property of their respective owners.
Use of this web site constitutes acceptance of the Terms of Use and Privacy Policy.
EduVideo.org
Hello all,
I'm new to the forums and new to developing with the Kaltura PHP API, so I hope this is in the right spot.
I'm developing a simple php application to provide video upload functionality for my site. I've implemented the KSU (http://www.kaltura.org/kaltura-simple-uploader-ksu) and it works great!
Now I understand that the video needs to convert for a few moments before its available, and I can see this status is in the KMC. The issue is, the KMC eventually reports that the video is ready. But, I still receive the following message, sometimes minutes later, when trying to play the video back:
Media is currently being converted, please try again in a few minutes
It eventually plays.. but what I'm wondering is, is something wrong? If not.. how can I determine when the video is *actually* playable.
Any help or advice would be appreciated!
Thanks,
- Jeff
Thanks for the reply. I did have a look at that KalturaEntryStatus. For a test case I dumped the contents of the KalturaMediaEntry on the same page as the widget and saw that it had a status of 2 (Ready) and still the widget would report that entry was still converting. A few refreshes later the video would start to play.
Thanks rtcwp07. Actually all the Enumerators used to be accessible on the Kaltura corp site but I can't find it anymore; they've been changing their site a lot and their documentation seems even more disorganized than ever... I hope it gets better.
Anyhow I figured how to do an api call to get the video status, in my case after uploading it. I'm running KalturaCE3.0 on a separate server from the api server.
Once you've created a session and created your kaltura client do the following:
$entry = $client->media->get($entry_id);
if ($entry->status == KalturaEntryStatus::READY)
return true;
else
return false;
Put this in a function like, is_uploaded($entry_id) and you've got something you can use anytime.
For other status Enumerations see the above post by rtcwp07.
If you need to wait for this status before doing more things with the video, such as making a Mix, you'll need to call this code in a loop obviously.
But if the time to wait it too long your apache (or whichever) server may timeout, especially for big videos. In this case I think using Notifications is the way to go, although I haven't tried it yet. For more on Notifications see http://corp.kaltura.org/wiki/index.php/Guides:Process_a_Notification
Cheers
no clue here what would cause that delay. never applied kaltura to a program that was time sensitive before. maybe try polling the batches?
well, no, nothing's really *wrong* there - it can take a variable amount of time before the video is indeed playable, depending on a number of factors.
you can certainly have your program ping the server every so often to check on the status of the new entry. for example, the media->get service returns a KalturaEntryStatus as part of its return object when given an entry ID. more info on the entry status values:
KalturaEntryStatus
ERROR_IMPORTING int -2
ERROR_CONVERTING int -1
IMPORT int 0
PRECONVERT int 1
READY int 2
DELETED int 3
PENDING int 4
MODERATE int 5
BLOCKED int 6
hope that helps.