diff options
author | TheTroll <trolldev@gmail.com> | 2010-02-23 19:17:19 +0100 |
---|---|---|
committer | TheTroll <trolldev@gmail.com> | 2010-02-23 19:17:19 +0100 |
commit | 9062d1fa575867946bed6c2feb4cea7e26695142 (patch) | |
tree | 025421f75aa8ed2b6df417fff2334dd07bd31d73 /includes/inc_files.php | |
parent | dd6e291748779399e9950f8810ffdd4eef1fdd4b (diff) | |
download | istreamdev-9062d1fa575867946bed6c2feb4cea7e26695142.tar.gz istreamdev-9062d1fa575867946bed6c2feb4cea7e26695142.tar.bz2 |
Display folder.jpg, poster.jpg or filename.tbn if present (picture must be resized for now)
Diffstat (limited to 'includes/inc_files.php')
-rwxr-xr-x | includes/inc_files.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/includes/inc_files.php b/includes/inc_files.php index 15ef491..8ddde5a 100755 --- a/includes/inc_files.php +++ b/includes/inc_files.php @@ -27,8 +27,18 @@ function mediagetinfostream($stream = "") } // Extract a thumbnail - exec("rm ram/stream-tb.png"); - exec($ffmpegpath ." -y -i \"" .$stream ."\" -an -ss 00:00:05.00 -r 1 -vframes 1 -s 128x72 -f mjpeg ram/stream-tb.png"); + exec("rm ram/stream-tb.*"); + + $path = dirname($stream); + + if (file_exists(substr($stream, 0, -4) .".tbn")) + exec("cp " .substr($stream, 0, -4) .".tbn ram/stream-tb.jpg"); + else if (file_exists($path ."/poster.jpg")) + exec("cp " .$path ."/poster.jpg ram/stream-tb.jpg"); + else if (file_exists($path ."/folder.jpg")) + exec("cp " .$path ."/folder.jpg ram/stream-tb.jpg"); + else + exec($ffmpegpath ." -y -i \"" .$stream ."\" -an -ss 00:00:05.00 -r 1 -vframes 1 -s 128x72 -f mjpeg ram/stream-tb.png"); return array($title, $info); } |