[Red5] prevent the scope from being freed upon disconnect
Iuri Diniz
iuridiniz at gmail.com
Fri Dec 12 05:12:54 PST 2008
On Fri, Dec 12, 2008 at 4:52 AM, Andy Shaules <bowljoman at hotmail.com> wrote:
>
> What does the scope do when nobody is connected? Is it something a
> 'schedualedJob' could do? Or could a schedualedJob do it all?
>
>
There´s a server side playlist running on that context
> Also, maybe there is a utillity-way to get the static var changed globally.
>
>
My complete problem:
I want to have 2 server side playlists with the same stream name, but
running different scopes (rooms)
So I create them when the app is staterd:
IScope one;
IScope two;
IServerStream streamOne;
IServerStream streamTwo;
@Override
public boolean appStart(IScope app) {
System.out.println("Java: appStart>" + app);
loadPlayLists(app);
return super.appStart(app);
}
@Override
public boolean start(IScope scope) {
System.out.println("Java: start>" + scope);
return super.start(scope);
}
@DeclarePrivate
private void loadPlayLists(IScope scope) {
scope.createChildScope("playlistOne");
one = scope.getScope("playListOne");
streamOne = loadPlayList(one);
scope.createChildScope("playlistTwo");
two = scope.getScope("playListTwo");
streamTwo = loadPlayList(two);
}
@DeclarePrivate
private IServerStream loadPlayList(IScope scope) {
System.out.println("Creating the playlist of " + scope );
IServerStream serverStream = StreamUtils.createServerStream( scope , "live"
);
SimplePlayItem item = new SimplePlayItem();
item.setName("IronMan.flv");
serverStream.addItem(item);
serverStream.setItem(0);
serverStream.setRewind(true);
serverStream.start();
System.out.println("Playlist of " + scope + " created");
return serverStream;
}
----------
When I connect each client to rtmp:/myApp/playlistOne (using publisher for
example), each client plays the same playlist (start of /playlistOne is
called only one time) , but when the last client disconnect (scope is
disconnect) and another client connect (start method is called again), this
client cannot play. But the serverStream continues up:
jvm 1 | 2008-12-12 11:08:43,931 [DefaultQuartzScheduler_Worker-9] INFO
org.r
ed5.server.stream.ProviderService - getVODProviderFile scope path:
/playlistOne name: I
ronMan.flv
jvm 1 | 2008-12-12 11:08:43,931 [DefaultQuartzScheduler_Worker-9] INFO
org.r
ed5.server.stream.ProviderService - getStreamFile null check - factory:
org.red5
.io.StreamableFileFactory at 186f3b3 name: IronMan.flv
Any ideais?
--
Iuri Diniz
http://iuridiniz.com
http://blog.igdium.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/red5_osflash.org/attachments/20081212/6b178eca/attachment.html>
More information about the Red5
mailing list