summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-02-24 17:20:04 +0100
committerTheTroll <trolldev@gmail.com>2010-02-24 17:20:04 +0100
commitff270318f7859bb99de1dc679ad3093c31f304dd (patch)
treedbb0e553c6bc349a6f5ea8eb99db1be07cd0d6e7 /includes
parent840252e0287b055e699af194b7357eccab4fce8a (diff)
downloadistreamdev-ff270318f7859bb99de1dc679ad3093c31f304dd.tar.gz
istreamdev-ff270318f7859bb99de1dc679ad3093c31f304dd.tar.bz2
Now redirect single files to playlist frontend (still buggy, file is not played yert)
Remove audiotypes conf (we only support native safari ext)
Diffstat (limited to 'includes')
-rwxr-xr-xincludes/inc_media.php26
-rwxr-xr-xincludes/inc_mp3.php7
2 files changed, 23 insertions, 10 deletions
diff --git a/includes/inc_media.php b/includes/inc_media.php
index 441ce3f..d0f94c1 100755
--- a/includes/inc_media.php
+++ b/includes/inc_media.php
@@ -1,6 +1,7 @@
<?php
-global $videotypes, $audiotypes;
+global $videotypes;
+$audiotypes='mp3 aac';
$subdir = $_REQUEST['subdir'];
$mediapath = $_REQUEST['mediapath'];
@@ -34,8 +35,15 @@ print " <ul class=\"pageitem\">";
print " <li class=\"textbox\"><span class=\"header\">Current path:</span><p>{$subdir}</p></li>";
// Option to play dir
+$audioextarray = explode(' ', $audiotypes);
+$playlist = 0;
+foreach ($audioextarray as $num => $audioext)
+{
+ if (glob($mediapath .$subdir .'*.' .$audioext))
+ $playlist = 1;
+}
-if (glob($mediapath .$subdir ."*.mp3"))
+if ($playlist)
{
print " <li class=\"menu\">\r\n";
print " <a href=\"index.php?action=playdir&mediapath={$mediapath}&subdir={$subdir}\">\r\n";
@@ -63,6 +71,8 @@ if ($medianame_array[0])
{
// Alphabetical sorting
sort($medianame_array);
+
+ $audiocnt=0;
foreach($medianame_array as $value)
{
@@ -88,9 +98,7 @@ if ($medianame_array[0])
$fileext = end(explode(".", $value));
// Check if it is supported
- if ( preg_match("/" .$fileext ." /", $videotypes)
- || preg_match("/" .$fileext ." $/", $videotypes)
- )
+ if ( preg_match("/" .$fileext ." /", $videotypes) || preg_match("/" .$fileext ." $/", $videotypes) )
{
print "<li class=\"menu\">\r\n";
print " <a class=\"noeffect\" href=\"javascript:sendForm('$medianame2');\">\r\n";
@@ -106,12 +114,12 @@ if ($medianame_array[0])
print " <input name=\"name\" type=\"hidden\" id=\"name\" value=\"{$mediapath}{$subdir}{$value}\" />";
print "</form>\r\n";
}
- else if ( preg_match("/" .$fileext ." /", $audiotypes)
- || preg_match("/" .$fileext ."$/", $audiotypes)
- )
+ else if ( preg_match("/" .$fileext ." /", $audiotypes) || preg_match("/" .$fileext ."$/", $audiotypes) )
{
+ $audiocnt++;
+
print "<li class=\"menu\">\r\n";
- print " <a href=\"streammusic.php?mediapath={$mediapath}&subdir={$subdir}&file={$value}\">\r\n";
+ print " <a href=\"index.php?action=playdir&mediapath={$mediapath}&subdir={$subdir}&play={$audiocnt}\">\r\n";
print " <img src=\"images/pictos/audio.png\" />\r\n";
print " <span class=\"name\">$value</span><span class=\"arrow\"></span>\r\n";
print " </a>\r\n";
diff --git a/includes/inc_mp3.php b/includes/inc_mp3.php
index 162ebcb..9e3cd62 100755
--- a/includes/inc_mp3.php
+++ b/includes/inc_mp3.php
@@ -1,6 +1,11 @@
<?php
-print "<body class=\"ipodlist\">\r\n";
+$play =$_REQUEST['play'];
+if ($play == "")
+ print "<body class=\"ipodlist\">\r\n";
+else
+ print "<body class=\"ipodlist\" onload=\"javascript:Document.s{$play}.Play()\">\r\n";
+
print "<div id=\"topbar\" class=\"transparent\">\r\n";
print "<div id=\"leftnav\">\r\n";
print " <a href=\"javascript:sendForm('getback')\">Back</a>\r\n";