response mp3 stream

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

response mp3 stream

Andreas Petermann
Hi list,

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?

regards

Andreas Petermann
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: response mp3 stream

Janko Mivšek
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
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: response mp3 stream

Andreas Petermann
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
> [hidden email]
> 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
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: response mp3 stream

Janko Mivšek
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
>> [hidden email]
>> http://lists.aidaweb.si/mailman/listinfo/aida
>

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: response mp3 stream

Andreas Petermann
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
[hidden email]
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

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: response mp3 stream

Janko Mivšek
Andreas Petermann wrote:

>> Andreas, just one more question, do you mean streaming a live content or
>> just mp3 files? Live streaming sounds very interesting .. ;)

> I think I have to disappoint you. I only want to response mp3 files :-(
>
Well, then you have your problem solved, just use serving static content
in Aida by setting your AIDASite homeDirectory: 'to my mp3 directory' an
voila, your mp3's will be served (actually streamed) to the web!

Let us know when you manage to set up your mp3 server correctly and how
a performance serving mp3's looks like.

Janko

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida