|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /home/queenjbs/junsu/ |
Upload File : |
<?
/**
저장된 동영상 시간
**/
require_once($_SERVER['DOCUMENT_ROOT'].'/plugin/getid3/getid3.php');
$getID3 = new getID3;
$file = $getID3->analyze($_SERVER['DOCUMENT_ROOT']."/files/muti/video/20180219_yuchun.mp4");
echo "- Duration: {$file['playtime_string']}<br>
- Dimensions: {$file['video']['resolution_x']}<br>
- wide by {$file['video']['resolution_y']}<br>
- tall Filesize: {$file['filesize']}bytes";
/*
function getYouTubeVideoID($url) {
$queryString = parse_url($url, PHP_URL_QUERY);
parse_str($queryString, $params);
if (isset($params['v']) && strlen($params['v']) > 0) {
return $params['v'];
} else {
return "";
}
}
// Getting Video ID
//$video_url = 'https://www.youtube.com/watch?v=1ejTKov_Sm4';
//echo getYouTubeVideoID($video_url); // Output: 1ejTKov_Sm4
$api_key = 'AIzaSyCuOBlaCtbyA-DesUd6M-Y1zJClrZRvOIA';
$video_url = 'https://www.youtube.com/watch?v=1ejTKov_Sm4';
$api_url = 'https://www.googleapis.com/youtube/v3/videos?part=snippet%2CcontentDetails%2Cstatistics&id=' . getYouTubeVideoID($video_url) . '&key=' . $api_key;
$url = 'https://graph.facebook.com/btaylor';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$g = curl_exec($ch);
curl_close($ch);
echo $g;
// $data = json_decode(file_get_contents($api_url));
// Accessing Video Info
echo '<strong>Title: </strong>' . $data->items[0]->snippet->title . '<br>';
echo '<strong>publishedAt: </strong>' . $data->items[0]->snippet->publishedAt . '<br>';
echo '<strong>Duration: </strong>' . $data->items[0]->contentDetails->duration . '<br>';
echo '<strong>Duration: </strong>' . $data->items[0]->statistics->viewCount . '<br>';
*/
?>