summaryrefslogtreecommitdiff
path: root/bin/session.php
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-03-18 01:07:28 +0100
committerTheTroll <trolldev@gmail.com>2010-03-18 01:07:28 +0100
commitef0bc7bd8c304fe13b941d62ff07da33f5f49315 (patch)
tree5c77fe376d8195e4ce0aae033121a98cd3004733 /bin/session.php
parent459abaa2386fd1935abf8b763aee046222b13a01 (diff)
downloadistreamdev-ef0bc7bd8c304fe13b941d62ff07da33f5f49315.tar.gz
istreamdev-ef0bc7bd8c304fe13b941d62ff07da33f5f49315.tar.bz2
Support audio streaming
Temporary video/audio sources
Diffstat (limited to 'bin/session.php')
-rwxr-xr-xbin/session.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/bin/session.php b/bin/session.php
index 09d793f..e17e166 100755
--- a/bin/session.php
+++ b/bin/session.php
@@ -262,4 +262,41 @@ function sessiongetlist()
return $sessions;
}
+function streammusic($path, $file)
+{
+ global $httppath;
+
+ $files = array();
+
+ // Create all symlinks
+ exec('mkdir ../playlist');
+ exec('rm ../playlist/*');
+ exec('ln -s ' .addcslashes(quotemeta($path), " &'") .'/* ../playlist');
+
+ // Generate files
+
+ // Get listing
+ $filelisting = filesgetlisting($path);
+
+ $addfiles = 0;
+
+ foreach ($filelisting as $f)
+ {
+ if ($f['type'] != 'audio')
+ continue;
+
+ if ($f['name'] == $file)
+ $addfiles = 1;
+
+ if ($addfiles)
+ {
+ $newfile = array();
+ $newfile['file'] = $httppath ."playlist/" . $f['name'];
+ $files[] = $newfile;
+ }
+ }
+
+ return $files;
+}
+
?>