SmokeTM
4 months ago
512
7
Laravel

Make sure Vimeo has completed transcoding of video on uploading

Posted 4 months ago by SmokeTM

I know its not really laravel related but maybe has used the laravel vimeo bridge package. My question is how to make sure a video is accessable and ready to work.

Here I am uploading the video to vimeo

$uri = Vimeo::upload($file, ['name' => $request->title], 'POST'); //upload video and get unique identifier

In my $uri I get the transcoding status "complete" , "in_progress", "error" I could check for. But how would I implement such a check should I use something like a sleep function and check after 2 or 3 mins if the video is ready? I have never done something like that before.

Something like that

sleep(5000);

if(status === complete) {}...

or

do {
//nothing
}while (status === "in_progress")

You get the Idea?

Best

Please sign in or create an account to participate in this conversation.