[Red5] plugging in PlaylistSubscriberStream
subpaul at gmail.com
Thu Nov 2 11:24:20 EST 2006
I actually did what I suggested and it works.
It works pretty well. How can I submit it back?
for the anxious, here is it what I did.
I added following bean to the red5-web.xml
<bean id="playlistSubscriberStream" scope="prototype" lazy-init="true"
and around line 217 in RTMPConnection, I removed part of the line that
creates a PlaylistSubscriberStream and replace it with this:
IContext context = scope.getContext();
ApplicationContext appCtx = context.getApplicationContext();
PlaylistSubscriberStream pss = (PlaylistSubscriberStream) appCtx.getBean
since I declared this bean prototype, spring creates a new instance
everything appCtx.Bean is called.
Now you can implement the Playlist however you want, I implemented one that
plays a track before it plays the real stream user asked for.
On 11/1/06, Paul Dhaliwal <subpaul at gmail.com> wrote:
> Thanks for the fast response and a good suggestion.
> I would like it to be a spring bean and have it configured as a property
> to something.
> At this point, if I want to keep things clean : not touch red5 code, I
> have to extend RTMPMinaIoHandler just to use my extension to
> PlaylistSubscriberStream. I would probably go that route so I don't have to
> deal with merging and stuff later on. There should be more plugging and
> stuff being done to make it a bit easier.
> I know this is a very special case and not trying to criticize red5 code.
> However, I would like to suggest the following.
> in the RTMPConnection, code should ask appCtx for new instance of a spring
> bean for each of the streams(ClientBroadcastStream and
> PlaylistSubscriberStream) whenever needed. To my knowledge spring can create
> a new instance of a Bean everytime you do a appCtx.getBean.
> I wouldn't mind writing the code and submitting a patch for this.
> Paul Dhaliwal
> On 11/1/06, Steven Gong < steven.gong at gmail.com> wrote:
> > Maybe a cleaner way is to wrap it as a bean and read it from spring
> > configuration.
> > On 11/2/06, Paul Dhaliwal < subpaul at gmail.com > wrote:
> > > I would like to extend PlaylistSubscriberStream and plug it in.
> > >
> > > I see that a new PlaylistSubscriberStream is created in
> > > RTMPMinaConnection and RTMPMinaConnection is created in RTMPMinaIOHanlder.
> > >
> > > There doesn't seem to be a clean way to plug in a
> > > PlaylistSubscriberStream. Can someone suggest the best way?
> > >
> > > Thanks in Advance.
> > > Paul Dhaliwal
> > >
> > > _______________________________________________
> > > Red5 mailing list
> > > Red5 at osflash.org
> > > http://osflash.org/mailman/listinfo/red5_osflash.org
> > >
> > >
> > >
> > --
> > I cannot tell why this heart languishes in silence. It is for small
> > needs it never asks, or knows or remembers. -- Tagore
> > Best Regards
> > Steven Gong
> > _______________________________________________
> > Red5 mailing list
> > Red5 at osflash.org
> > http://osflash.org/mailman/listinfo/red5_osflash.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Red5