예제 #1
0
 private static function video_get_vimeo($url, $width = 640, $height = 360)
 {
     preg_match('/vimeo\\.com\\/([0-9]{1,10})/', $url, $matches);
     $video_id = $matches[1];
     // Check if a valid url
     if (!Net::check_http_code('http://vimeo.com/api/v2/video/' . $video_id . '.php', 200)) {
         return false;
     }
     $hash = unserialize(file_get_contents('http://vimeo.com/api/v2/video/' . $video_id . '.php'));
     $info = array();
     $info['id'] = $video_id;
     $info['title'] = $hash[0]['title'];
     $info['description'] = $hash[0]['description'];
     $info['thumb'][0] = $hash[0]['thumbnail_medium'];
     $info['thumb'][1] = $hash[0]['thumbnail_small'];
     $info['embed'] = '<iframe class="vimeo_embed" width="' . $width . '" height="' . $height . '" src="http://player.vimeo.com/video/' . $video_id . '"  frameborder="0" allowFullScreen></iframe>';
     return $info;
 }