[aida] response mp3 stream

Andreas Petermann PetePetermann at gmx.de
Mon Jan 7 10:28:30 CET 2008


Hi Janko,

thanks for your fast answer. I will try it.

best regards
Andreas

> 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
> AIDASite.
> 
> 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
> 
> 
> -- 
> Janko Mivšek
> AIDA/Web
> Smalltalk Web Application Server
> http://www.aidaweb.si
> _______________________________________________
> Aida mailing list
> Aida at aidaweb.si
> http://lists.aidaweb.si/mailman/listinfo/aida

-- 
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 mailing list