Class Session

java.lang.Object
com.flashphoner.fpwcsapi.session.Session

public class Session extends Object
Stream and call management API Session object is a session between Android app and WCS server One session can create many streams or SIP calls
  • Constructor Details

    • Session

      public Session(SessionOptions sessionOptions, Consumer<Session> disconnectConsumer)
      New session based on sessionOptions
      Parameters:
      sessionOptions -
  • Method Details

    • connect

      public void connect(Connection connection, Map<String,String> customHeaders)
      Connect to server with additional connection parameters and custom HTTP headers
      Parameters:
      connection - Additional connection parameters
      customHeaders - Custom HTTP headers
    • connect

      public void connect(Connection connection)
      Connect to server with additional connection parameters
      Parameters:
      connection - Additional connection parameters
    • createStream

      public Stream createStream(StreamOptions streamOptions)
      Create new stream for publishing or playing
      Parameters:
      streamOptions - options for stream: stream name, renderer for displaying video, constraints for audio and video
      Returns:
      Created stream
    • createCall

      public Call createCall(CallOptions callOptions)
      Create a new SIP call
      Parameters:
      callOptions -
      Returns:
      Created call
      See Also:
    • send

      public void send(String message)
      Send rpc message to handler
      Parameters:
      message - Method name
    • send

      public void send(String message, Object data)
      Send rpc message to handler with data
      Parameters:
      message - Method name
      data - Custom data (will be converted to json)
    • disconnect

      public void disconnect()
      Disconnect from server (status: DISCONNECTED)
    • disconnect

      public void disconnect(String status)
      Disconnect from server with custom status
      Parameters:
      status -
    • getId

      public String getId()
      Get identifier of session
      Returns:
    • getSessionOptions

      public SessionOptions getSessionOptions()
      Get SessionOptions of created session
      Returns:
    • getRestAppCommunicator

      public RestAppCommunicator getRestAppCommunicator()
      Get rest application communicator of data (currently used in room)
      Returns:
    • on

      public void on(SessionEvent sessionEvent)
      Set event listener statuses and data
      Parameters:
      sessionEvent -
    • on

      public void on(IncomingCallEvent incomingCallEvent)
      Handle incoming call
      Parameters:
      incomingCallEvent -