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

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -