summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-02-25 19:22:16 +0100
committerTheTroll <trolldev@gmail.com>2010-02-25 19:22:16 +0100
commit627da0570e79865643ae3c23c0f5244ac46d5d68 (patch)
treeda526f76a8176a0f182f275f5834bccc7c8a0e59
parentc57e43d3caa214c0067ed1ec452fc5cd94c67121 (diff)
downloadistreamdev-627da0570e79865643ae3c23c0f5244ac46d5d68.tar.gz
istreamdev-627da0570e79865643ae3c23c0f5244ac46d5d68.tar.bz2
Added a source type and now show the media browsing respect to the type
-rwxr-xr-xconfig_default.php7
-rwxr-xr-xincludes/inc_audio.php13
-rwxr-xr-xincludes/inc_home.php16
-rwxr-xr-xincludes/inc_media.php17
-rwxr-xr-xincludes/inc_stream.php2
-rwxr-xr-xincludes/inc_video.php13
-rwxr-xr-xincludes/include.php7
7 files changed, 45 insertions, 30 deletions
diff --git a/config_default.php b/config_default.php
index ee3e6a2..3a2dba0 100755
--- a/config_default.php
+++ b/config_default.php
@@ -15,9 +15,10 @@
// Media configuration
$videotypes='avi mkv ts mov mp4 wmv flv mpg mpeg mpeg2 mpv '; // Supported video extensions (must finish with a space)
- // Source name Source path
- $mediasources=array ( 'Video' => '/mnt/media/movies',
- 'Audio' => '/mnt/media/music');
+ // 1:vid 2:aud Source name Source path
+ $mediasource=array();
+ $mediasources[]=array ( 1, 'Video', '/mnt/media/movies');
+ $mediasources[]=array ( 2, 'Audio', '/mnt/media/music');
// Encoding
// Name Video Audio Audio channels Resolution
diff --git a/includes/inc_audio.php b/includes/inc_audio.php
index 1806703..b1f58e3 100755
--- a/includes/inc_audio.php
+++ b/includes/inc_audio.php
@@ -2,6 +2,15 @@
global $httppath;
+$mediapath = $_REQUEST['mediapath'];
+$subdir = $_REQUEST['subdir'];
+
+/* Add last slash to dirs */
+if ($mediapath[strlen($mediapath)-1] != '/')
+ $mediapath = $mediapath .'/';
+if ($subdir[strlen($subdir)-1] != '/')
+ $subdir = $subdir .'/';
+
print "<body class=\"ipodlist\">\r\n";
print "<div id=\"topbar\" class=\"transparent\">\r\n";
print "<div id=\"leftnav\">\r\n";
@@ -50,7 +59,7 @@ if ($medianame_array[0])
print " </a>\r\n";
print " </li>\r\n";
print " <form name=\"dir_{$medianame_array[$cnt]}\" id=\"dir_{$medianame_array[$cnt]}\" method=\"post\" action=\"index.php\">\r\n";
- print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"media\"/>\r\n";
+ print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"audio\"/>\r\n";
print " <input name=\"mediapath\" type=\"hidden\" id=\"mediapath\" value=\"{$mediapath}\" />\r\n";
print " <input name=\"subdir\" type=\"hidden\" id=\"subdir\" value=\"{$subdir}{$medianame_array[$cnt]}\" />\r\n";
print " </form>\r\n";
@@ -98,7 +107,7 @@ else
$upsubdir = dirname($subdir);
print " <form name=\"getback\" id=\"getback\" method=\"post\" action=\"index.php\">\r\n";
-print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"media\" />\r\n";
+print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"audio\" />\r\n";
print " <input name=\"mediapath\" type=\"hidden\" id=\"mediapath\" value=\"{$mediapath}\" />\r\n";
print " <input name=\"subdir\" type=\"hidden\" id=\"subdir\" value=\"{$upsubdir}\" />\r\n";
print " </form>\r\n";
diff --git a/includes/inc_home.php b/includes/inc_home.php
index 9515860..d907b87 100755
--- a/includes/inc_home.php
+++ b/includes/inc_home.php
@@ -27,17 +27,27 @@ if ($vdrenabled)
// Media menus
print " <span class=\"graytitle\">MEDIA</span>\r\n";
print " <ul class=\"pageitem\">\r\n";
-foreach($mediasources as $sname => $spath)
+foreach($mediasources as $source)
{
+ $stype = $source[0];
+ $sname = $source[1];
+ $spath = $source[2];
+
print " <li class=\"menu\">\r\n";
print " <a class=\"noeffect\" href=\"javascript:sendForm('media {$sname} {$spath}');\">\r\n";
- print " <img src=\"images/pictos/media.png\" />\r\n";
+ if ($stype == 1)
+ print " <img src=\"images/pictos/video.png\" />\r\n";
+ else
+ print " <img src=\"images/pictos/audio.png\" />\r\n";
print " <span class=\"name\">{$sname}</span>\r\n";
print " <span class=\"arrow\"></span>\r\n";
print " </a>\r\n";
print " </li>\r\n";
print " <form name=\"media\" id=\"media {$sname} {$spath}\" method=\"post\" action=\"index.php\">\r\n";
- print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"media\" />\r\n";
+ if ($stype == 1)
+ print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"video\" />\r\n";
+ else
+ print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"audio\" />\r\n";
print " <input name=\"mediapath\" type=\"hidden\" id=\"mediapath\" value=\"{$spath}\" />\r\n";
print " <input name=\"subdir\" type=\"hidden\" id=\"subdir\" value=\"/\" />\r\n";
print " </form>\r\n";
diff --git a/includes/inc_media.php b/includes/inc_media.php
deleted file mode 100755
index e0f7cb9..0000000
--- a/includes/inc_media.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-
-$mediapath = $_REQUEST['mediapath'];
-$subdir = $_REQUEST['subdir'];
-
-/* Add last slash to dirs */
-if ($mediapath[strlen($mediapath)-1] != '/')
- $mediapath = $mediapath .'/';
-if ($subdir[strlen($subdir)-1] != '/')
- $subdir = $subdir .'/';
-
-// Use the right media type
-if (mediadirhasaudio($mediapath .$subdir))
- include ('includes/inc_audio.php');
-else
- include ('includes/inc_video.php');
-?>
diff --git a/includes/inc_stream.php b/includes/inc_stream.php
index aa3179b..b98b132 100755
--- a/includes/inc_stream.php
+++ b/includes/inc_stream.php
@@ -211,7 +211,7 @@ else
case 3:
$mediapath = $_REQUEST['mediapath'];
$subdir = $_REQUEST['subdir'];
- print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"media\" />";
+ print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"video\" />";
print " <input name=\"mediapath\" type=\"hidden\" id=\"mediapath\" value=\"{$mediapath}\" />\r\n";
print " <input name=\"subdir\" type=\"hidden\" id=\"subdir\" value=\"{$subdir}\" />\r\n";
break;
diff --git a/includes/inc_video.php b/includes/inc_video.php
index d933a04..10a5714 100755
--- a/includes/inc_video.php
+++ b/includes/inc_video.php
@@ -1,5 +1,14 @@
<?php
+$mediapath = $_REQUEST['mediapath'];
+$subdir = $_REQUEST['subdir'];
+
+/* Add last slash to dirs */
+if ($mediapath[strlen($mediapath)-1] != '/')
+ $mediapath = $mediapath .'/';
+if ($subdir[strlen($subdir)-1] != '/')
+ $subdir = $subdir .'/';
+
print "<body onorientationchange=\"updateOrientation();\" onload=\"updateOrientation();\">\r\n";
print "<div id=\"topbar\" class=\"transparent\">\r\n";
print "<div id=\"leftnav\">\r\n";
@@ -57,7 +66,7 @@ if ($medianame_array[0])
print " </a>\r\n";
print "</li>\r\n";
print "<form name=\"$value\" id=\"$value\" method=\"post\" action=\"index.php\">";
- print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"media\"/>";
+ print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"video\"/>";
print " <input name=\"mediapath\" type=\"hidden\" id=\"mediapath\" value=\"{$mediapath}\" />";
print " <input name=\"subdir\" type=\"hidden\" id=\"subdir\" value=\"{$subdir}{$value}\" />\r\n";
print "</form>\r\n";
@@ -91,7 +100,7 @@ if ($medianame_array[0])
$upsubdir = dirname($subdir);
print "<form name=\"getback\" id=\"getback\" method=\"post\" action=\"index.php\">\r\n";
-print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"media\"/>\r\n";
+print " <input name=\"action\" type=\"hidden\" id=\"action\" value=\"video\"/>\r\n";
print " <input name=\"mediapath\" type=\"hidden\" id=\"mediapath\" value=\"{$mediapath}\" />\r\n";
print " <input name=\"subdir\" type=\"hidden\" id=\"subdir\" value=\"{$upsubdir}\" />\r\n";
print "</form>\r\n";
diff --git a/includes/include.php b/includes/include.php
index bf18d55..42cf446 100755
--- a/includes/include.php
+++ b/includes/include.php
@@ -40,8 +40,11 @@ function selectpage()
case ("recordings"):
include('includes/inc_rec.php');
break;
- case ("media"):
- include('includes/inc_media.php');
+ case ("video"):
+ include('includes/inc_video.php');
+ break;
+ case ("audio"):
+ include('includes/inc_audio.php');
break;
case ("epg"):
include('includes/inc_epg.php');