summaryrefslogtreecommitdiffstats
path: root/stream.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-23 06:08:14 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-23 06:08:14 +0000
commit216e691dfa53a28af8beca7aad2bf0ffb71dba2c (patch)
tree8b371e856d8107832a724f1ee0ad42f270435d0a /stream.php
parent84eca6a3d59fc591a7e28b3d7e0c11746dc837fc (diff)
downloadampache-216e691dfa53a28af8beca7aad2bf0ffb71dba2c.tar.gz
ampache-216e691dfa53a28af8beca7aad2bf0ffb71dba2c.tar.bz2
ampache-216e691dfa53a28af8beca7aad2bf0ffb71dba2c.zip
- Added Live Stream (Internet Radio) support
- New Database Update corrects some issues and makes internet radio possible - Fixed ratings - Added new Transcode preference, doesn't do anything yet - New "Radio Stations" browse type
Diffstat (limited to 'stream.php')
-rw-r--r--stream.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/stream.php b/stream.php
index b200fa69..76670a82 100644
--- a/stream.php
+++ b/stream.php
@@ -50,7 +50,24 @@ switch ($_REQUEST['action']) {
if (!count($song_ids)) { header("Location:" . return_referer()); exit; }
break;
case 'basket':
- $song_ids = $GLOBALS['user']->playlist->get_items();
+ // Pull in our items (multiple types)
+ $objects = $GLOBALS['user']->playlist->get_items();
+
+ //Recurse through the objects
+ foreach ($objects as $object_data) {
+ // Switch on the type of object we've got in here
+ switch ($object_data['1']) {
+ case 'radio':
+ $radio = new Radio($object_data['0']);
+ $urls[] = $radio->url;
+ break;
+ case 'song':
+ default:
+ $song_ids[] = $object_data['0'];
+ break;
+ } // end switch on type
+ } // end foreach
+
break;
/* This is run if we need to gather info based on a tmp playlist */
case 'tmp_playlist':
@@ -163,6 +180,11 @@ switch ($_REQUEST['method']) {
/* Start the Stream */
$stream = new Stream($stream_type,$song_ids);
+ if (is_array($urls)) {
+ foreach ($urls as $url) {
+ $stream->manual_url_add($url);
+ }
+ }
$stream->start();
break;
} // end method switch