Class Space


  • public final class Space
    extends java.lang.Object
    A Space is where participants meet. Participants can publish their own tracks and subscribe to other publishers.

    A Space sends events to a Space.Listener as a way to relay state updates.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void disconnect()
      Disconnect from the Space
      java.lang.String getConnectionId()  
      java.lang.String getId()
      Retrieve the ID of this space
      LocalParticipant getLocalParticipant()
      Get the local participant in this Space

      There is only one local participant in a Space, and it has the ability to publish and unpublish local tracks.
      Participant getParticipant​(java.lang.String participantId)
      Retrieve the participant by ID Safe to access from the UI thread
      java.lang.String getParticipantId()  
      java.util.HashMap<java.lang.String,​Participant> getParticipants()
      Gets a map of all participants in the space, indexed by their IDs Safe to access from the UI thread
      void join​(Space.Listener listener)
      Join the Space with the provided (mandatory) Listener.
      void leave​(Space.Listener listener, boolean keepSpaceActiveWithNoListeners)
      Leave the Space and unregister the given listener

      When there are no listeners in a Space the Space will disconnect unless the provided boolean is true.
      void submitAcrScore​(Space.AcrScore acrScore, Space.AcrScoreSubmissionCallback callback)
      Submit an Absolute Category Rating (ACR) score for this user's session.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • join

        public void join​(@NotNull
                         Space.Listener listener)
        Join the Space with the provided (mandatory) Listener.

        The Listener will receive events from the Space.
        Parameters:
        listener -
      • leave

        public void leave​(@NotNull
                          Space.Listener listener,
                          boolean keepSpaceActiveWithNoListeners)
        Leave the Space and unregister the given listener

        When there are no listeners in a Space the Space will disconnect unless the provided boolean is true. If it has been set then the Space will stay active for a short grace period to allow an opportunity for another listener to join. This facility is used in the getting started guide to simplify configuration change handling.
        Parameters:
        listener -
        keepSpaceActiveWithNoListeners -
      • getId

        public java.lang.String getId()
        Retrieve the ID of this space
        Returns:
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • disconnect

        public void disconnect()
        Disconnect from the Space
      • getConnectionId

        public java.lang.String getConnectionId()
      • getLocalParticipant

        public LocalParticipant getLocalParticipant()
        Get the local participant in this Space

        There is only one local participant in a Space, and it has the ability to publish and unpublish local tracks.

        This getter is provided so that you can access the local camera and microphone tracks before even joining a Space so things like previews can be implemented.
        Returns:
      • getParticipant

        public Participant getParticipant​(java.lang.String participantId)
        Retrieve the participant by ID Safe to access from the UI thread
        Parameters:
        participantId -
        Returns:
      • getParticipants

        public java.util.HashMap<java.lang.String,​Participant> getParticipants()
        Gets a map of all participants in the space, indexed by their IDs Safe to access from the UI thread
        Returns:
      • getParticipantId

        public java.lang.String getParticipantId()
      • submitAcrScore

        public void submitAcrScore​(Space.AcrScore acrScore,
                                   Space.AcrScoreSubmissionCallback callback)
        Submit an Absolute Category Rating (ACR) score for this user's session. This allows collection of user feedback regarding the general quality of experience of their Space's session The callback is to allow you to check for the submission completion. .
        Parameters:
        acrScore -
        callback -