Skip to content

Commit

Permalink
add set_thumbnail examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jererc committed Mar 12, 2012
1 parent e57415a commit 3da191f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions example.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$res = $cloudkey->file->upload_file($video_file);
print_r($res);

# The url of the uploaded video
# The url of the uploaded video
$source_url = $res->url;

# The list of encoding assets that we want
Expand Down Expand Up @@ -60,5 +60,12 @@

echo 'the video "' . $title . '" with id: '. $media_id . ' was created on ' . strftime("%c", $created) . ' and has a duration of ' . $duration . " seconds.\n";

# Get the URL of a thumbnai
# Get the URL of a thumbnail
echo $cloudkey->media->get_stream_url(array('id' => $media_id, 'asset_name' => 'jpeg_thumbnail_source'));


// We set the thumbnail from a url (jpeg file)
$cloudkey->media->set_thumbnail(array('id' => $media_id, 'url' => 'http://farm5.static.flickr.com/4026/5153920292_354be441b3_o.jpg'));

// We set a thumbnail based on a timecode (format = HH:MM:SS.mm - HH: 2 digits hours, MM: 2 digits minutes, SS: 2 digits seconds, mm: 2 digits ms)
$cloudkey->media->set_thumbnail(array('id' => $media_id, 'timecode' => '00:00:03.00'));

0 comments on commit 3da191f

Please sign in to comment.