[aida] response mp3 stream
PetePetermann at gmx.de
Mon Jan 7 10:28:30 CET 2008
thanks for your fast answer. I will try it.
> Hi Andreas,
> Andreas Petermann wrote:
> > how is it possible to response a mp3 stream with aida? I have tried out
> > a lot of things about the answer methods but all seems to be only a
> > workaround of the standard response method of aida. Is there a special
> > way to response a stream?
> If you mean mp3 files, they are already streamed as all other static
> content. Just put them on a directory defined by #homeDirectory in
> If you'd like to have a live streaming of mp3 content then look at how a
> FileProxy is done, specially #printHTMLPageOn:forSession:
> printHTMLPageOn: aStream forSession: aSession
> | response |
> self isRespondingStreamed ifTrue:
> [response := aSession lastRequest streamedResponse.
> self site addResponseHeadersTo: response forPage: self on: aSession.
> self streamFileToResponse: response.
> response close]
> streamFileToResponse: aHTTPStreamedResponse
> | stream |
> [stream := self filename asFilename readStream binary.
> [stream atEnd] whileFalse:
> [aHTTPStreamedResponse nextPut: stream next] ]
> ensure: [stream close]
> So, I would make a class (say Streamer) and adjust above methods,
> especially last one, for live streaming.
> I hope this will help you a bit
> Janko Mivšek
> Smalltalk Web Application Server
> Aida mailing list
> Aida at aidaweb.si
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
More information about the Aida