get_thumb
Function : get_thumb File : functions_videos.php Since : v2.x
This function is used to get thumbnails of a video.
This function will get all video thumbnails and list them in array, you can single thumbnail using incremental number or all thumbnails in an array or just count how many thumbnails are available. This function has few limitations that we will try to cover in upcoming updates.
Usage
get_thumb($vdetails,$num=โ€™defaultโ€™,$multi=false,$count=false,$return_full_path=true,$return_big=true,$size=Null);
Uses
  • default_thumb();
  • MyQuery->get_video_details();
paramater marked with * is required
Parameter Name
Options
$vdetails (Array|Int) *
It can either be an array of video details or just videoid and it will automatically fetch video details
$num (Int)
incremental number of thumb, default is 1, depends on how many thumbs generation you have set, by default there are 3 thumbs that clipbucket generates so you can set this between 1 to 3.if set to 2 it will return http://website.tld/files/thumbs/filename-2.jpg
$multi (Boolean)
default is false, on setting true it will return a complete list of thumbs in an array.
$count (Boolean)
default is false, if set to true, this function will only return number of thumbs of videos (int)
$return_full_path (Boolean)
default is true, it will return thumbail with complete URL i.e http://website.td/files/thumbs/filename-1.jpg, if set to false it will only return filename-1.jpg
$return_big (Boolean)
default is false, if set to true it will return big thumbnail of video, depends on what resolution you have set in configuration default is 320ร—240 and file name will be filename-big-1.jpg
$size (String)
default is null, depends on what size you want, it can be 120ร—90 or whatever sizes you have set for thumbs generation

Examples

1
<?php
2
โ€‹
3
//set your videoid, it can also bevideokey
4
$vid = 1236;
5
$vdetails = get_video_details($vid);
6
$default_thumb = get_thumb($vdetails);
7
$second_thumb = get_thumb($vdetails,2);
8
$all_thumbs = get_thumb($vdetails,NULL,true);
9
$count_thumbs = get_thumb($vdetails,NULL,false,true);
10
โ€‹
11
echo '<pre>';
12
var_dump($default_thumb);
13
var_dump($second_thumb);
14
var_dump($all_thumbs);
15
var_dump($count_thumbs);
16
echo '</pre>';
17
?&gt
Copied!
โ€‹
Loading...
Last modified 12d ago
Copy link