From ee59e19183a839784e6ac30ed639548e4f36615e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 18 Feb 2010 17:48:07 +0100 Subject: Second rev with media streaming. Now it works for all video types. And some more bugfixes Committer: Alib modified: HISTORY modified: config.php modified: css/style.css modified: includes/inc_media.php modified: includes/inc_rec.php modified: includes/inc_stream.php modified: includes/inc_vdr.php modified: includes/include.php modified: istream.sh --- includes/inc_media.php | 55 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 15 deletions(-) (limited to 'includes/inc_media.php') diff --git a/includes/inc_media.php b/includes/inc_media.php index 3d1f820..53788c2 100755 --- a/includes/inc_media.php +++ b/includes/inc_media.php @@ -1,11 +1,18 @@ \"home\"\r\n"; else print "Back\r\n"; +if ($dir != $mediapath) +{ print "
\r\n"; print "\"home\"
\r\n"; +} print "
iStreamdev
\r\n"; print "\r\n"; print "
\r\n"; @@ -26,38 +36,53 @@ print "
"; print " {$subdir}\r\n"; print "
    "; -$dir_handle = @opendir($dir) or die("Unable to open $dir"); - -while ($medianame = readdir($dir_handle)) +$dir_handle = @opendir($dir); +if (!$dir_handle) +{ + print "Unable to open $dir"; +} +else while ($medianame = readdir($dir_handle)) { if($medianame == "." || $medianame == ".." || $medianame == 'lost+found') continue; - + $medianame2=addslashes($medianame); - if (strstr($medianame, ".avi") == ".avi") + // Directories + if (is_dir($dir ."/" .$medianame)) { print "
  • $medianame
  • \r\n"; print "
    "; - print " "; - print " "; - print " "; + print " "; + print " "; print "
    \r\n"; } else { - print "
  • $medianame
  • \r\n"; - print "
    "; - print " "; - print " "; - print "
    \r\n"; + // Get file extension + $fileext = end(explode(".", $medianame)); + + // Check if it is supported + if ( preg_match("'" .$fileext ." '", $videotypes) + || preg_match("'" .$fileext ." $'", $videotypes) + ) + { + print "
  • $medianame
  • \r\n"; + print "
    "; + print " "; + print " "; + print " "; + print "
    \r\n"; + } } } $updir = dirname($dir); print "
    \r\n"; -closedir($dir_handle); + +if ($dir_handle) + closedir($dir_handle); print "
\r\n"; ?> -- cgit v1.2.3