summaryrefslogtreecommitdiff
path: root/includes/inc_files.php
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-02-24 22:54:18 +0100
committerTheTroll <trolldev@gmail.com>2010-02-24 22:54:18 +0100
commit3d72b276b17a920a3f319afd2aec44d7bdf7a40e (patch)
tree460a30a3e2828032ffcfb5d4a85efe0725d8a246 /includes/inc_files.php
parentb28b92b318e55387fa24283195163bab32c8bf69 (diff)
downloadistreamdev-3d72b276b17a920a3f319afd2aec44d7bdf7a40e.tar.gz
istreamdev-3d72b276b17a920a3f319afd2aec44d7bdf7a40e.tar.bz2
Better management of audio/video media
Diffstat (limited to 'includes/inc_files.php')
-rwxr-xr-xincludes/inc_files.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/includes/inc_files.php b/includes/inc_files.php
index f593ba9..7a6f5a8 100755
--- a/includes/inc_files.php
+++ b/includes/inc_files.php
@@ -1,5 +1,7 @@
<?php
+$audiotypes='mp3 aac';
+
function mediagetinfostream($stream = "")
{
@@ -43,4 +45,30 @@ function mediagetinfostream($stream = "")
return array($title, $info);
}
+function mediagettype($file)
+{
+ global $videotypes, $audiotypes;
+
+ // Get file extension
+ $fileext = end(explode(".", $file));
+ if (is_dir($file))
+ return 3;
+ if ( preg_match("/" .$fileext ." /", $videotypes) || preg_match("/" .$fileext ." $/", $videotypes) )
+ return 1;
+ else if ( preg_match("/" .$fileext ." /", $audiotypes) || preg_match("/" .$fileext ." $/", $audiotypes) )
+ return 2;
+ else
+ return 0;
+}
+
+function mediadirhasaudio($dir)
+{
+ global $audiotypes;
+
+ $audioextarray = explode(' ', $audiotypes);
+ foreach ($audioextarray as $num => $audioext)
+ if (glob($dir .'*.' .$audioext))
+ return 1;
+ return 0;
+}