diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-02-02 04:25:25 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-02-02 04:25:25 +0000 |
commit | 00effbf55451016e5863e27de93344dfb4a50216 (patch) | |
tree | fe1300051d65f14fd34dd53bc7148a47c8e3d5a6 /play | |
parent | 0a2b41b143419e85b968a675c8b83a1c15615399 (diff) | |
download | ampache-00effbf55451016e5863e27de93344dfb4a50216.tar.gz ampache-00effbf55451016e5863e27de93344dfb4a50216.tar.bz2 ampache-00effbf55451016e5863e27de93344dfb4a50216.zip |
Add very basic buggy as crap video support, fix a few other minor bugs with playlists and random elements
Diffstat (limited to 'play')
-rw-r--r-- | play/index.php | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/play/index.php b/play/index.php index f8d0dd6a..93ea49bf 100644 --- a/play/index.php +++ b/play/index.php @@ -32,9 +32,10 @@ ob_end_clean(); /* These parameters had better come in on the url. */ $uid = scrub_in($_REQUEST['uid']); -$song_id = scrub_in($_REQUEST['song']); +$song_id = $_REQUEST['song'] ? scrub_in($_REQUEST['song']) : scrub_in($_REQUEST['oid']); $sid = scrub_in($_REQUEST['sid']); $xml_rpc = scrub_in($_REQUEST['xml_rpc']); +$video = make_bool($_REQUEST['video']); /* This is specifically for tmp playlist requests */ $demo_id = scrub_in($_REQUEST['demo_id']); @@ -151,9 +152,16 @@ if ($random) { } } // if random -/* Base Checks passed create the song object */ -$song = new Song($song_id); -$song->format(); +if (!$video) { + /* Base Checks passed create the song object */ + $song = new Song($song_id); + $song->format(); +} +else { + $song = new Video($song_id); + $song->format(); +} + $catalog = new Catalog($song->catalog); /* If the song is disabled */ @@ -162,9 +170,6 @@ if (!make_bool($song->enabled)) { exit; } - - - // If we are running in Legalize mode, don't play songs already playing if (Config::get('lock_songs')) { if (!check_lock_songs($song->id)) { @@ -303,7 +308,7 @@ if ((Config::get('transcode') == 'always' || !$song->native_stream() || $not_loc else { // Send file, possible at a byte offset $fp = fopen($song->file, 'rb'); - + if (!is_resource($fp)) { debug_event('file_read_error',"Error: Unable to open $song->file for reading",'2'); cleanup_and_exit($lastid); |