Class MultiThreadedApplicationAdapter

All Implemented Interfaces:
IEventHandler, IAttributeStore, ISchedulingService, IScopeAware, IScopeHandler, IScopeService, IBroadcastStreamService, IOnDemandStreamService, IStreamSecurityService, ISubscriberStreamService, ISharedObjectSecurityService, ISharedObjectService, IStreamAwareScopeHandler, IWebSocketAwareHandler, ApplicationMXBean, AttributeStoreMXBean
Direct Known Subclasses:
ApplicationAdapter

ApplicationAdapter class serves as a base class for your Red5 applications. It provides methods to work with SharedObjects and streams, as well as connections and scheduling services.
ApplicationAdapter is an application level IScope. To handle streaming processes in your application you should implement IStreamAwareScopeHandler interface and implement handling methods.
Application adapter provides you with useful event handlers that can be used to intercept streams, authorize users, etc. Also, all methods added in subclasses can be called from client side with NetConnection.call method. Unlike to Flash Media server which requires you to keep methods on Client object at server side, Red5 offers much more convenient way to add methods
EXAMPLE:
public List<String> getLiveStreams() { // Implementation goes here, say, use Red5 object to obtain scope and all it's streams }
This method added to ApplicationAdapter subclass can be called from client side with the following code:
var nc:NetConnection = new NetConnection(); nc.connect(...); nc.call("getLiveStreams", resultHandlerObj);
If you want to build a server-side framework this is a place to start and wrap it around ApplicationAdapter subclass.
Author:
The Red5 Project, Joachim Bauch (jojo@struktur.de), Paul Gregoire (mondain@gmail.com), Michael Klishin
  • Field Details

    • log

      protected org.slf4j.Logger log
      Logger object
    • schedulingService

      protected ISchedulingService schedulingService
      Scheduling service; adds and removes scheduled jobs.
    • providerService

      protected IProviderService providerService
      Provider service.
  • Constructor Details

    • MultiThreadedApplicationAdapter

      public MultiThreadedApplicationAdapter()
  • Method Details

    • addListener

      public void addListener(IApplication listener)
      Register a listener that will get notified about application events.
      Parameters:
      listener - object to register
    • removeListener

      public void removeListener(IApplication listener)
      Unregister handler that will not get notified about application events any longer.
      Parameters:
      listener - object to unregister
    • getListeners

      public Set<IApplication> getListeners()
      Return handlers that get notified about application events.
      Returns:
      list of handlers
    • registerStreamPublishSecurity

      public void registerStreamPublishSecurity(IStreamPublishSecurity handler)
      Add handler that protects stream publishing.
      Specified by:
      registerStreamPublishSecurity in interface IStreamSecurityService
      Parameters:
      handler - Handler to add.
    • unregisterStreamPublishSecurity

      public void unregisterStreamPublishSecurity(IStreamPublishSecurity handler)
      Remove handler that protects stream publishing.
      Specified by:
      unregisterStreamPublishSecurity in interface IStreamSecurityService
      Parameters:
      handler - Handler to remove.
    • getStreamPublishSecurity

      public Set<IStreamPublishSecurity> getStreamPublishSecurity()
      Get handlers that protect stream publishing.
      Specified by:
      getStreamPublishSecurity in interface IStreamSecurityService
      Returns:
      a Set object
    • registerStreamPlaybackSecurity

      public void registerStreamPlaybackSecurity(IStreamPlaybackSecurity handler)
      Add handler that protects stream playback.
      Specified by:
      registerStreamPlaybackSecurity in interface IStreamSecurityService
      Parameters:
      handler - Handler to add.
    • unregisterStreamPlaybackSecurity

      public void unregisterStreamPlaybackSecurity(IStreamPlaybackSecurity handler)
      Remove handler that protects stream playback.
      Specified by:
      unregisterStreamPlaybackSecurity in interface IStreamSecurityService
      Parameters:
      handler - Handler to remove.
    • getStreamPlaybackSecurity

      public Set<IStreamPlaybackSecurity> getStreamPlaybackSecurity()
      Get handlers that protect stream plaback.
      Specified by:
      getStreamPlaybackSecurity in interface IStreamSecurityService
      Returns:
      a Set object
    • registerSharedObjectSecurity

      public void registerSharedObjectSecurity(ISharedObjectSecurity handler)
      Add handler that protects shared objects.
      Specified by:
      registerSharedObjectSecurity in interface ISharedObjectSecurityService
      Parameters:
      handler - Handler to add.
    • unregisterSharedObjectSecurity

      public void unregisterSharedObjectSecurity(ISharedObjectSecurity handler)
      Remove handler that protects shared objects.
      Specified by:
      unregisterSharedObjectSecurity in interface ISharedObjectSecurityService
      Parameters:
      handler - Handler to remove.
    • getSharedObjectSecurity

      public Set<ISharedObjectSecurity> getSharedObjectSecurity()
      Get handlers that protect shared objects.
      Specified by:
      getSharedObjectSecurity in interface ISharedObjectSecurityService
      Returns:
      a Set object
    • rejectClient

      protected boolean rejectClient() throws ClientRejectedException
      Reject the currently connecting client without a special error message. This method throws ClientRejectedException exception.
      Returns:
      never returns
      Throws:
      ClientRejectedException - Thrown when client connection must be rejected by application logic
    • rejectClient

      protected boolean rejectClient(Object reason) throws ClientRejectedException
      Reject the currently connecting client with an error message. The passed object will be available as "application" property of the information object that is returned to the caller.
      Parameters:
      reason - Additional error message to return to client-side Flex/Flash application
      Returns:
      never returns
      Throws:
      ClientRejectedException - Thrown when client connection must be rejected by application logic
    • connect

      public boolean connect(IConnection conn)
      Returns connection result for given scope and parameters. Whether the scope is room or app level scope, this method distinguishes it and acts accordingly. You override appConnect(IConnection, Object[]) or roomConnect(IConnection, Object[]) in your application to make it act the way you want.
      Parameters:
      conn - Connection object
      Returns:
      true if connect is successful, false otherwise
    • connect

      public boolean connect(IConnection conn, IScope scope, Object[] params)
      Called just before every connection to a scope. You can pass additional params from client using NetConnection.connect method (see below). Returns connection result for given scope and parameters. Whether the scope is room or app level scope, this method distinguishes it and acts accordingly. You override appConnect(IConnection, Object[]) or roomConnect(IConnection, Object[]) in your application to make it act the way you want.
      Specified by:
      connect in interface IScopeHandler
      Overrides:
      connect in class AbstractScopeAdapter
      Parameters:
      conn - a IConnection object
      scope - a IScope object
      params - an array of Object objects
      Returns:
      a boolean
    • start

      public boolean start(IScope scope)
      Called when a scope is created for the first time. Starts scope. Scope can be both application or room level.
      Specified by:
      start in interface IScopeHandler
      Overrides:
      start in class AbstractScopeAdapter
      Parameters:
      scope - the new scope object
      Returns:
      true to allow, false to deny
    • disconnect

      public void disconnect(IConnection conn, IScope scope)
      Called just after the a connection is disconnected. Returns disconnection result for given scope and parameters. Whether the scope is room or app level scope, this method distinguishes it and acts accordingly.
      Specified by:
      disconnect in interface IScopeHandler
      Overrides:
      disconnect in class AbstractScopeAdapter
      Parameters:
      conn - Connection object
      scope - Scope object
    • stop

      public void stop(IScope scope)
      Called just before a scope is disposed. Stops scope handling (that is, stops application if given scope is app level scope and stops room handling if given scope has lower scope level). This method calls appStop(IScope) or roomStop(IScope) handlers respectively.
      Specified by:
      stop in interface IScopeHandler
      Overrides:
      stop in class AbstractScopeAdapter
      Parameters:
      scope - Scope that id disposed
    • join

      public boolean join(IClient client, IScope scope)
      Called just before a client enters the scope. Adds client to scope. Scope can be both application or room. Can be applied to both application scope and scopes of lower level. This method calls appJoin(IClient, IScope) or roomJoin(IClient, IScope) handlers respectively.
      Specified by:
      join in interface IScopeHandler
      Overrides:
      join in class AbstractScopeAdapter
      Parameters:
      client - Client object
      scope - Scope that is joined by client
      Returns:
      true to allow, false to deny
    • leave

      public void leave(IClient client, IScope scope)
      Called just after the client leaves the scope. Disconnects client from scope. Can be applied to both application scope and scopes of lower level. This method calls appLeave(IClient, IScope) or roomLeave(IClient, IScope) handlers respectively.
      Specified by:
      leave in interface IScopeHandler
      Overrides:
      leave in class AbstractScopeAdapter
      Parameters:
      client - Client object
      scope - Scope object
    • appStart

      public boolean appStart(IScope app)

      appStart.

      Called once on scope (that is, application or application room) start. You override appStart(IScope) or roomStart(IScope) in your application to make it act the way you want.
      Specified by:
      appStart in interface ApplicationMXBean
      Parameters:
      app - a IScope object
      Returns:
      a boolean
    • appStop

      public void appStop(IScope app)

      appStop.

      Handler method. Called when application is stopped.
      Specified by:
      appStop in interface ApplicationMXBean
      Parameters:
      app - a IScope object
    • roomStart

      public boolean roomStart(IScope room)

      roomStart.

      Handler method. Called when room scope is started.
      Specified by:
      roomStart in interface ApplicationMXBean
      Parameters:
      room - a IScope object
      Returns:
      a boolean
    • roomStop

      public void roomStop(IScope room)

      roomStop.

      Handler method. Called when room scope is stopped.
      Specified by:
      roomStop in interface ApplicationMXBean
      Parameters:
      room - a IScope object
    • appConnect

      public boolean appConnect(IConnection conn, Object[] params)
      Handler method. Called every time new client connects (that is, new IConnection object is created after call from a SWF movie) to the application.
      You override this method to pass additional data from client to server application using NetConnection.connect method.
      EXAMPLE:
      In this simple example we pass user's skin of choice identifier from client to the server.
      Client-side:
      NetConnection.connect("rtmp://localhost/killerred5app", "silver");
      Server-side:
      if (params.length > 0) log.debug("Theme selected: {}", params[0]);
      Specified by:
      appConnect in interface ApplicationMXBean
      Parameters:
      conn - Connection object
      params - List of parameters after connection URL passed to NetConnection.connect method.
      Returns:
      Boolean value
    • appConnect

      public boolean appConnect(WebSocketConnection wsConn, Object[] params)
      Handler method. Called when a WebSocket connects to the application.
      Specified by:
      appConnect in interface IWebSocketAwareHandler
      Parameters:
      wsConn - a WebSocketConnection object
      params - List of parameters after connection URL
      Returns:
      true upon success, false otherwise
    • roomConnect

      public boolean roomConnect(IConnection conn, Object[] params)
      Handler method. Called every time new client connects (that is, new IConnection object is created after call from a SWF movie) to the application. You override this method to pass additional data from client to server application using NetConnection.connect method. See appConnect(IConnection, Object[]) for code example.
      Specified by:
      roomConnect in interface ApplicationMXBean
      Parameters:
      conn - Connection object
      params - List of params passed to room scope
      Returns:
      Boolean value
    • appDisconnect

      public void appDisconnect(IConnection conn)

      appDisconnect.

      Handler method. Called every time client disconnects from the application.
      Specified by:
      appDisconnect in interface ApplicationMXBean
      Parameters:
      conn - a IConnection object
    • appDisconnect

      public boolean appDisconnect(WebSocketConnection wsConn)
      Handler method. Called when a WebSocket disconnects from the application.
      Specified by:
      appDisconnect in interface IWebSocketAwareHandler
      Parameters:
      wsConn - WebSocket connection object
      Returns:
      true upon success, false otherwise
    • roomDisconnect

      public void roomDisconnect(IConnection conn)

      roomDisconnect.

      Handler method. Called every time client disconnects from the room.
      Specified by:
      roomDisconnect in interface ApplicationMXBean
      Parameters:
      conn - a IConnection object
    • appJoin

      public boolean appJoin(IClient client, IScope app)

      appJoin.

      Specified by:
      appJoin in interface ApplicationMXBean
      Parameters:
      client - a IClient object
      app - a IScope object
      Returns:
      a boolean
    • appLeave

      public void appLeave(IClient client, IScope app)

      appLeave.

      Handler method. Called every time client leaves application scope.
      Specified by:
      appLeave in interface ApplicationMXBean
      Parameters:
      client - a IClient object
      app - a IScope object
    • roomJoin

      public boolean roomJoin(IClient client, IScope room)

      roomJoin.

      Specified by:
      roomJoin in interface ApplicationMXBean
      Parameters:
      client - a IClient object
      room - a IScope object
      Returns:
      a boolean
    • roomLeave

      public void roomLeave(IClient client, IScope room)

      roomLeave.

      Handler method. Called every time client leaves room scope.
      Specified by:
      roomLeave in interface ApplicationMXBean
      Parameters:
      client - a IClient object
      room - a IScope object
    • measureBandwidth

      public void measureBandwidth()
      Try to measure bandwidth of current connection. This is required for some FLV player to work because they require the "onBWDone" method to be called on the connection.
    • measureBandwidth

      public void measureBandwidth(IConnection conn)
      Try to measure bandwidth of given connection. This is required for some FLV player to work because they require the "onBWDone" method to be called on the connection.
      Parameters:
      conn - the connection to measure the bandwidth for
    • createSharedObject

      public boolean createSharedObject(IScope scope, String name, boolean persistent)
      Create a new shared object. Creates a new shared object for given scope. Server-side shared objects (also known as Remote SO) are special kind of objects those variable are synchronized between clients. To get an instance of RSO at client-side, use SharedObject.getRemote() . SharedObjects can be persistent and transient. Persistent RSO are stateful, i.e. store their data between sessions. If you need to store some data on server while clients go back and forth use persistent SO (just use true ), otherwise prefer usage of transient for extra performance.
      Specified by:
      createSharedObject in interface ISharedObjectService
      Parameters:
      scope - the scope to create the shared object in
      name - the name of the shared object
      persistent - will the shared object be persistent
      Returns:
       true
       
      if the shared object was created or already exists, otherwise
       false
       
    • getSharedObject

      public ISharedObject getSharedObject(IScope scope, String name)
      Get a shared object by name. Returns shared object from given scope by name.
      Specified by:
      getSharedObject in interface ISharedObjectService
      Parameters:
      scope - the scope to get the shared object from
      name - the name of the shared object
      Returns:
      shared object, or
       null
       
      if not found
    • getSharedObject

      public ISharedObject getSharedObject(IScope scope, String name, boolean persistent)
      Get a shared object by name and create it if it doesn't exist. Returns shared object from given scope by name.
      Specified by:
      getSharedObject in interface ISharedObjectService
      Parameters:
      scope - the scope to get the shared object from
      name - the name of the shared object
      persistent - should the shared object be created persistent
      Returns:
      the shared object
    • getSharedObjectNames

      public Set<String> getSharedObjectNames(IScope scope)
      Get a set of the shared object names. Returns available SharedObject names as List
      Specified by:
      getSharedObjectNames in interface ISharedObjectService
      Parameters:
      scope - the scope to return the shared object names from
      Returns:
      set containing the shared object names
    • hasSharedObject

      public boolean hasSharedObject(IScope scope, String name)
      Check if a shared object exists. Checks whether there's a SO with given scope and name
      Specified by:
      hasSharedObject in interface ISharedObjectService
      Parameters:
      scope - the scope to check for the shared object
      name - the name of the shared object
      Returns:
       true
       
      if the shared object exists, otherwise
       false
       
    • clearSharedObjects

      public boolean clearSharedObjects(IScope scope, String name)

      Deletes persistent shared objects specified by name and clears all properties from active shared objects (persistent and nonpersistent). The name parameter specifies the name of a shared object, which can include a slash (/) as a delimiter between directories in the path. The last element in the path can contain wildcard patterns (for example, a question mark [?] and an asterisk [*]) or a shared object name. The clearSharedObjects() method traverses the shared object hierarchy along the specified path and clears all the shared objects. Specifying a slash (/) clears all the shared objects associated with an application instance.

      The following values are possible for the soPath parameter:
      / clears all local and persistent shared objects associated with the instance.
      /foo/bar clears the shared object /foo/bar; if bar is a directory name, no shared objects are deleted.
      /foo/bar/* clears all shared objects stored under the instance directory /foo/bar. The bar directory is also deleted if no persistent shared objects are in use within this namespace.
      /foo/bar/XX?? clears all shared objects that begin with XX, followed by any two characters. If a directory name matches this specification, all the shared objects within this directory are cleared.

      If you call the clearSharedObjects() method and the specified path matches a shared object that is currently active, all its properties are deleted, and a "clear" event is sent to all subscribers of the shared object. If it is a persistent shared object, the persistent store is also cleared.


      Specified by:
      clearSharedObjects in interface ISharedObjectService
      Parameters:
      scope - the scope to check for the shared object
      name - the name of the shared object
      Returns:
      true if the shared object at the specified path was deleted; otherwise, false. If using wildcard characters to delete multiple files, the method returns true only if all the shared objects matching the wildcard pattern were successfully deleted; otherwise, it will return false.
    • hasBroadcastStream

      public boolean hasBroadcastStream(IScope scope, String name)
      Does the scope have a broadcast stream registered with a given name
      Specified by:
      hasBroadcastStream in interface IBroadcastStreamService
      Parameters:
      scope - the scope to check for the stream
      name - name of the broadcast
      Returns:
      true is a stream exists, otherwise false
    • getBroadcastStream

      public IBroadcastStream getBroadcastStream(IScope scope, String name)
      Get a broadcast stream by name
      Specified by:
      getBroadcastStream in interface IBroadcastStreamService
      Parameters:
      scope - the scope to return the stream from
      name - the name of the broadcast
      Returns:
      broadcast stream object
    • getBroadcastStreams

      public Set<IBroadcastStream> getBroadcastStreams(IScope scope)
      Returns broadcast streams registered on the scope.
      Specified by:
      getBroadcastStreams in interface IBroadcastStreamService
      Parameters:
      scope - a IScope object
      Returns:
      set of broadcast streams or empty if none exist
    • getBroadcastStreamNames

      public Set<String> getBroadcastStreamNames(IScope scope)
      Get a set containing the names of all the broadcasts Returns list of stream names broadcasted in scope. Broadcast stream name is somewhat different from server stream name. Server stream name is just an ID assigned by Red5 to every created stream. Broadcast stream name is the name that is being used to subscribe to the stream at client side, that is, in NetStream.play call.
      Specified by:
      getBroadcastStreamNames in interface IBroadcastStreamService
      Parameters:
      scope - the scope to search for streams
      Returns:
      set containing all broadcast names
    • hasOnDemandStream

      public boolean hasOnDemandStream(IScope scope, String name)
      Has the service an on-demand stream with the passed name? Check whether scope has VOD stream with given name or not
      Specified by:
      hasOnDemandStream in interface IOnDemandStreamService
      Parameters:
      scope - the scope to check for the stream
      name - the name of the stream
      Returns:
      true if the stream exists, false otherwise
    • getOnDemandStream

      public IOnDemandStream getOnDemandStream(IScope scope, String name)
      Get a stream that can be used for playback of the on-demand stream Returns VOD stream with given name from specified scope.
      Specified by:
      getOnDemandStream in interface IOnDemandStreamService
      Parameters:
      scope - the scope to return the stream from
      name - the name of the stream
      Returns:
      the on-demand stream
    • getSubscriberStream

      public ISubscriberStream getSubscriberStream(IScope scope, String name)
      Returns a stream that can subscribe a broadcast stream with the given name using "IBroadcastStream.subscribe". Returns subscriber stream with given name from specified scope. Subscriber stream is a stream that clients can subscribe to.
      Specified by:
      getSubscriberStream in interface ISubscriberStreamService
      Parameters:
      scope - the scope to return the stream from
      name - the name of the stream
      Returns:
      the stream object
    • addScheduledJob

      public String addScheduledJob(int interval, IScheduledJob job)
      Schedule a job for periodic execution. Wrapper around ISchedulingService, adds a scheduled job to be run periodically. We store this service in the scope as it can be shared across all rooms of the applications.
      Specified by:
      addScheduledJob in interface ISchedulingService
      Parameters:
      interval - time in milliseconds between two notifications of the job
      job - the job to trigger periodically
      Returns:
      the name of the scheduled job
    • addScheduledOnceJob

      public String addScheduledOnceJob(long timeDelta, IScheduledJob job)
      Schedule a job for single execution in the future. Please note that the jobs are not saved if Red5 is restarted in the meantime. Adds a scheduled job that's gonna be executed once. Please note that the jobs are not saved if Red5 is restarted in the meantime.
      Specified by:
      addScheduledOnceJob in interface ISchedulingService
      Parameters:
      timeDelta - time delta in milliseconds from the current date
      job - the job to trigger
      Returns:
      the name of the scheduled job
    • addScheduledOnceJob

      public String addScheduledOnceJob(Date date, IScheduledJob job)
      Schedule a job for single execution at a given date. Please note that the jobs are not saved if Red5 is restarted in the meantime. Adds a scheduled job that's gonna be executed once on given date. Please note that the jobs are not saved if Red5 is restarted in the meantime.
      Specified by:
      addScheduledOnceJob in interface ISchedulingService
      Parameters:
      date - date when the job should be executed
      job - the job to trigger
      Returns:
      the name of the scheduled job
    • addScheduledJobAfterDelay

      public String addScheduledJobAfterDelay(int interval, IScheduledJob job, int delay)
      Schedule a job for periodic execution which will start after the specified delay. Adds a scheduled job which starts after the specified delay period and fires periodically.
      Specified by:
      addScheduledJobAfterDelay in interface ISchedulingService
      Parameters:
      interval - time in milliseconds between two notifications of the job
      job - the job to trigger periodically
      delay - time in milliseconds to pass before first execution.
      Returns:
      the name of the scheduled job
    • pauseScheduledJob

      public void pauseScheduledJob(String name)
      Pauses the trigger which initiates job execution. Pauses a scheduled job
      Specified by:
      pauseScheduledJob in interface ISchedulingService
      Parameters:
      name - name of the job to stop
    • resumeScheduledJob

      public void resumeScheduledJob(String name)
      Resumes the trigger which initiates job execution. Resumes a scheduled job
      Specified by:
      resumeScheduledJob in interface ISchedulingService
      Parameters:
      name - name of the job to stop
    • removeScheduledJob

      public void removeScheduledJob(String name)
      Stop executing a previously scheduled job. Removes scheduled job from scheduling service list
      Specified by:
      removeScheduledJob in interface ISchedulingService
      Parameters:
      name - name of the job to stop
    • getScheduledJobNames

      public List<String> getScheduledJobNames()
      Returns list of scheduled job names
      Specified by:
      getScheduledJobNames in interface ISchedulingService
      Returns:
      List of scheduled job names as list of Strings.
    • getStreamLength

      public double getStreamLength(String name)
      Returns stream length. This is a hook so it may be removed.
      Parameters:
      name - Stream name
      Returns:
      Stream length in seconds (?)
    • getClientTTL

      @Deprecated public long getClientTTL()
      Deprecated.
      Client time to live is max allowed connection ping return time in seconds
      Returns:
      TTL value used in seconds
    • setClientTTL

      @Deprecated public void setClientTTL(int clientTTL)
      Deprecated.
      Client time to live is max allowed connection ping return time in seconds
      Parameters:
      clientTTL - New TTL value in seconds
    • getGhostConnsCleanupPeriod

      @Deprecated public int getGhostConnsCleanupPeriod()
      Deprecated.
      Return period of ghost connections cleanup task call
      Returns:
      Ghost connections cleanup period
    • setGhostConnsCleanupPeriod

      @Deprecated public void setGhostConnsCleanupPeriod(int ghostConnsCleanupPeriod)
      Deprecated.
      Set new ghost connections cleanup period
      Parameters:
      ghostConnsCleanupPeriod - New ghost connections cleanup period
    • startTransmit

      public void startTransmit(Boolean bool, int num)
      Start transmission notification from Flash Player 11.1+. This command asks the server to transmit more data because the buffer is running low. http://help.adobe.com/en_US/flashmediaserver/devguide/WSd391de4d9c7bd609-569139412a3743e78e-8000.html
      Parameters:
      bool - boolean
      num - number
    • stopTransmit

      public void stopTransmit()
      Stop transmission notification from Flash Player 11.1+. This command asks the server to suspend transmission until the client sends a startTransmit event because there is enough data in the buffer.
    • stopTransmit

      public void stopTransmit(Boolean bool, int num)
      Stop transmission notification from Flash Player 11.1+. This command asks the server to suspend transmission until the client sends a startTransmit event because there is enough data in the buffer.
      Parameters:
      bool - boolean
      num - number
    • FCPublish

      public void FCPublish(String streamName)
      Notification method that is sent by FME just before publishing starts.
      Parameters:
      streamName - Name of stream that is about to be published.
    • FCUnpublish

      public void FCUnpublish()
      Notification method that is sent by FME when publishing of a stream ends.
    • FCUnpublish

      public void FCUnpublish(String streamName)
      Notification method that is sent by FME when publishing of a stream ends.
      Parameters:
      streamName - Name of stream that is about to be un-published.
    • FCSubscribe

      public void FCSubscribe(String streamName)
      Notification method that is sent by some clients just before playback starts.
      Parameters:
      streamName - Name of stream that is about to be played.
    • streamBroadcastClose

      public void streamBroadcastClose(IBroadcastStream stream)
      Notified when a broadcaster closes. Notification that a broadcasting stream is closing.
      Specified by:
      streamBroadcastClose in interface IStreamAwareScopeHandler
      Parameters:
      stream - stream
    • streamBroadcastStart

      public void streamBroadcastStart(IBroadcastStream stream)
      Notified when a broadcaster starts.
      Specified by:
      streamBroadcastStart in interface IStreamAwareScopeHandler
      Parameters:
      stream - stream
    • streamPlayItemPlay

      public void streamPlayItemPlay(ISubscriberStream stream, IPlayItem item, boolean isLive)
      Notified when a play item plays.
      Specified by:
      streamPlayItemPlay in interface IStreamAwareScopeHandler
      Parameters:
      stream - stream
      item - item
      isLive - true if live
    • streamPlayItemStop

      public void streamPlayItemStop(ISubscriberStream stream, IPlayItem item)
      Notified when a play item stops.
      Specified by:
      streamPlayItemStop in interface IStreamAwareScopeHandler
      Parameters:
      stream - stream
      item - item
    • streamPlayItemPause

      public void streamPlayItemPause(ISubscriberStream stream, IPlayItem item, int position)
      Notified when a play item pauses.
      Specified by:
      streamPlayItemPause in interface IStreamAwareScopeHandler
      Parameters:
      stream - stream
      item - item
      position - position
    • streamPlayItemResume

      public void streamPlayItemResume(ISubscriberStream stream, IPlayItem item, int position)
      Notified when a play item resumes.
      Specified by:
      streamPlayItemResume in interface IStreamAwareScopeHandler
      Parameters:
      stream - stream
      item - item
      position - position
    • streamPlayItemSeek

      public void streamPlayItemSeek(ISubscriberStream stream, IPlayItem item, int position)
      Notified when a play item seeks.
      Specified by:
      streamPlayItemSeek in interface IStreamAwareScopeHandler
      Parameters:
      stream - stream
      item - item
      position - position
    • streamPublishStart

      public void streamPublishStart(IBroadcastStream stream)
      A broadcast stream starts being published. This will be called when the first video packet has been received.
      Specified by:
      streamPublishStart in interface IStreamAwareScopeHandler
      Parameters:
      stream - stream
    • streamRecordStart

      public void streamRecordStart(IBroadcastStream stream)
      A broadcast stream starts being recorded. This will be called when the first video packet has been received.
      Specified by:
      streamRecordStart in interface IStreamAwareScopeHandler
      Parameters:
      stream - stream
    • streamRecordStop

      public void streamRecordStop(IBroadcastStream stream)
      A broadcast stream stops being recorded. This will be called when the record-stop notification is sent to the Flash client.
      Specified by:
      streamRecordStop in interface IStreamAwareScopeHandler
      Parameters:
      stream - stream
    • streamSubscriberClose

      public void streamSubscriberClose(ISubscriberStream stream)
      Notified when a subscriber closes.
      Specified by:
      streamSubscriberClose in interface IStreamAwareScopeHandler
      Parameters:
      stream - stream
    • streamSubscriberStart

      public void streamSubscriberStart(ISubscriberStream stream)
      Notified when a subscriber starts.
      Specified by:
      streamSubscriberStart in interface IStreamAwareScopeHandler
      Parameters:
      stream - stream
    • setPeerInfo

      public void setPeerInfo()
      RTMFP peer connect event handler.
      See Also:
    • handleEvent

      public boolean handleEvent(IEvent event)
      Handle an event.
      Specified by:
      handleEvent in interface IEventHandler
      Overrides:
      handleEvent in class AbstractScopeAdapter
      Parameters:
      event - to handle
      Returns:
      true if event was handled, false if it should bubble