Interface Session.SessionListener

Enclosing class:
Session

public static interface Session.SessionListener
Monitors state changes in a Session object.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Invoked when the client connects to the OpenTok session.
    void
    Invoked when the client is no longer connected to the OpenTok session.
    void
    onError(Session session, OpentokError error)
    Invoked when something goes wrong when connecting or connected to the session.
    void
    onStreamDropped(Session session, Stream stream)
    Invoked when another client stops publishing a stream to this OpenTok session.
    void
    onStreamReceived(Session session, Stream stream)
    Invoked when a there is a new stream published by another client in this OpenTok session.
  • Method Details

    • onConnected

      void onConnected(Session session)
      Invoked when the client connects to the OpenTok session.
      Parameters:
      session - The session your client connected to.
    • onDisconnected

      void onDisconnected(Session session)
      Invoked when the client is no longer connected to the OpenTok session.
      Parameters:
      session - The session your client disconnected from.
    • onStreamReceived

      void onStreamReceived(Session session, Stream stream)
      Invoked when a there is a new stream published by another client in this OpenTok session.
      Parameters:
      session - The session in which the stream was added.
      stream - A Stream object representing the new stream, which can be used to create a Subscriber.
    • onStreamDropped

      void onStreamDropped(Session session, Stream stream)
      Invoked when another client stops publishing a stream to this OpenTok session.
      Parameters:
      session - The session from which the stream was removed.
      stream - A Stream object representing the dropped stream, which can be used to identify a Subscriber.
    • onError

      void onError(Session session, OpentokError error)
      Invoked when something goes wrong when connecting or connected to the session. After this method is invoked, the Session should be treated as dead and unavailable. Do not attempt to reconnect or to call other methods of the Session object.

      This method is called if the attempt to connect to the session fails. It is also called if the connection to the session drops due to an error after a successful connection, and in this case the method is called just before the onDisconnected(Session session) method is called.

      Parameters:
      session - The session in which the error occurred.
      error - An error describing the cause for error.