java - How to Identify Publishers and Consumers using Red5 API -
public boolean connect(iconnection conn, iscope scope, object[] params) { iclient client = conn.getclient(); log.info( "app connect " + conn.getclient().getid() ); client.setattribute( "stamp", new long( 0 ) ); return true; }
this method being called every time client connected @ custom application in red5 server ,so there way identify if client subscriber (consumer ,viewer) or publisher (user streams @ server).
bests
to disallow or allow publish or subscribe user, can use methods inside appstart callback method:
- registerstreamplaybacksecurity
- registerstreampublishsecurity
for more, the:
http://dl.fancycode.com/red5/api/org/red5/server/adapter/multithreadedapplicationadapter.html
i'm using jruby, , it's easy so:
registerstreamplaybacksecurity |scope, name, start, len, flush| false # no playback allowed end registerstreampublishsecurity |scope, name, mode| rand(1) % 1 == 0 # publishing (recording) allowed, no end
Comments
Post a Comment