From 749d6ac386cee84cc2db0c678c16e774394911a0 Mon Sep 17 00:00:00 2001 From: Knah Tsaeb Date: Tue, 20 Aug 2013 15:38:46 +0200 Subject: [PATCH] [add] video size in video view --- inc/content.php | 4 ++++ index.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/inc/content.php b/inc/content.php index dd368ea..f4a25a3 100644 --- a/inc/content.php +++ b/inc/content.php @@ -256,6 +256,10 @@ if (!empty($ci['ac']) && $ci['ac'] === 'view' && !empty($listCurrentFile)) { Duration ', $videoInfo['duration'], ' + + + Size + ', $videoInfo['size'], ' Publish date ', date("d m Y", strtotime($videoInfo['uploadDate'])), ' diff --git a/index.php b/index.php index 5f3d983..e06f87a 100644 --- a/index.php +++ b/index.php @@ -455,6 +455,9 @@ function getVideoInfo($file, $dir, $fullListFile) { $path = chunk_split($dir, 8, '/'); $descFile = glob($GLOBALS['config']['VIDEODIR']."/".$path.$file."*.json"); $jsonInfo = json_decode(file_get_contents($descFile[0])); + $jsonSize = explode(' - ', htmlentities($jsonInfo -> format)); + $jsonSize = explode('x', $jsonSize[1]); + $size = $jsonSize[1].'x'.$jsonSize[0]; $time = gmdate('H\hi\ms\s', $jsonInfo -> duration); @@ -470,6 +473,7 @@ function getVideoInfo($file, $dir, $fullListFile) { 'format' => htmlentities($jsonInfo -> format), 'ext' => htmlentities($jsonInfo -> ext), 'duration' => htmlentities($time), + 'size' => htmlentities($size), 'via' => $postInfo['via'], 'licence' => $postInfo['licence'] );