Jordash
Jordash

Reputation: 3103

PHP Cloudinary Video output not working

I uploaded a video onto cloudinary and am trying to get it to show using any of Cloudinarys PHP functions, here is the code I tried:

<?php
require 'cloudinary/src/Cloudinary.php';
require 'cloudinary/src/Uploader.php';
require 'cloudinary/src/Api.php';
\Cloudinary::config(array( 
  "cloud_name" => "hidden", 
  "api_key" => "hidden", 
  "api_secret" => "hidden" 
));
?>
<?php 
    echo cl_video_tag("homeCut1_h7e00z", array("video_codec"=>"auto"));
?>

the hidden was obviously replaced with the correct keys.

I tried it without the echo and nothing shows up, when I do it with the echo an image thumbnail of the video shows, but it's not playable.

Upvotes: 0

Views: 147

Answers (1)

Nadav Ofir
Nadav Ofir

Reputation: 778

The image that you're seeing is actually the video preview (poster attribute).
It looks like you're missing the controls parameter which cause the player controls to be displayed.

Try this instead:

echo cl_video_tag("homeCut1_h7e00z", array("video_codec"=>"auto", "controls"=>"controls"));

Upvotes: 1

Related Questions