[aida] response mp3 stream

Andreas Petermann petepetermann at gmx.de
Mon Jan 7 18:49:21 CET 2008


Janko Mivšek schrieb:
> Andreas, just one more question, do you mean streaming a live content or 
> just mp3 files? Live streaming sounds very interesting .. ;)
>
> Best regards
> Janko
>
> Andreas Petermann wrote:
>   
>> 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
>>>       
>
>   
Hi Janko,
I think I have to disappoint you. I only want to response mp3 files :-(

regards
Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.aidaweb.si/pipermail/aida/attachments/20080107/4a24d95c/attachment.htm 


More information about the Aida mailing list