Remove some of the roundabout complexity that had built up. Push people
toward using a single, flexible tool for most of their transcoding
needs. Increase backend and configuration flexibility to support
user-requested format changes (e.g. for an HTML5 player); this
functionality is not yet exposed.
Now that playback doesn't pretend it's supported, we don't need the
fragile hacks to support guessing the content size or 'seeking' within
a transcoded stream.
It's a little suspect to automatically delete them just because another
was used. Waiting for them to expire will get rid of them plenty quick,
with less chance for weird issues.
Should fix the VLC plugin, as well as allow direct use of an Ampache
site on Android devices.
First, split the Stream class into an instantiable class that does the
playlist wrangling and a static class that handles the streaming stuff.
How does this work? Well, stream.php does its fancy stuff like
gathering the media IDs and clearing the playlist, but instead
of generating the playlist file there we use the Stream_Playlist
class to store the list of URLs in the database, then redirect to
play/index.php to create the actual download (there are some magic
playlist types like localplay that don't need to redirect.)
The playlist will be cached as long as that stream session is active, so
it can be downloaded multiple times and by clients that don't share the
browser's cookie cache.
Clean up the playlist generation by reducing copypasta.
Initial tag is case sensitive; we were emitting [Playlist] but some
players don't accept that. There is unfortunately no real standard to
check, but this does match what Winamp (ack, pthbbt) does.
Derive our new filesize from the length, not the previous bitrate and
size. Allow higher bitrates than the source when they're different
formats. Return HTTP error codes when an error occurs. Minor cleanup.
Prototype functionality where possible (particularly for Ajax). Move our JS
into lib/javascript (I dropped kajax as an external module since the new
ajax.js is completely different apart from function headers.) Remove unused
JS functions from base.js.