• Returns {
        cleanUp: (() => void);
        connect: ((url, peerToken) => Promise<void>);
        error: null | string;
        join: ((peerMetadata) => Promise<void>);
        leave: (() => void);
    }

    • cleanUp: (() => void)

      Disconnect from the room, and close the websocket connection. Tries to leave the room gracefully, but if it fails, it will close the websocket anyway.

        • (): void
        • Disconnect from the room, and close the websocket connection. Tries to leave the room gracefully, but if it fails, it will close the websocket anyway.

          Returns void

    • connect: ((url, peerToken) => Promise<void>)

      Connects to the server using the websocket connection. If jellyfish server is in local network, on iOS devices make sure to grant local network permission before calling this function. Otherwise, the function will fail unless the user grants that permission.

      Param: url

      websocket url

      Param: peerToken

      token used to authenticate when joining the room

        • (url, peerToken): Promise<void>
        • Connects to the server using the websocket connection. If jellyfish server is in local network, on iOS devices make sure to grant local network permission before calling this function. Otherwise, the function will fail unless the user grants that permission.

          Parameters

          • url: string

            websocket url

          • peerToken: string

            token used to authenticate when joining the room

          Returns Promise<void>

    • error: null | string
    • join: ((peerMetadata) => Promise<void>)

      Tries to join the room. If user is accepted then onJoinSuccess will be called. In other case onJoinError is invoked.

      Param: peerMetadata

      Any information that other peers will receive in onPeerJoined after accepting this peer.

        • (peerMetadata): Promise<void>
        • Tries to join the room. If user is accepted then onJoinSuccess will be called. In other case onJoinError is invoked.

          Parameters

          • peerMetadata: Metadata

            Any information that other peers will receive in onPeerJoined after accepting this peer.

          Returns Promise<void>

    • leave: (() => void)

      Leaves the room. This function should be called when user leaves the room in a clean way e.g. by clicking a dedicated, custom button disconnect. As a result there will be generated one more media event that should be sent to the RTC Engine. Thanks to it each other peer will be notified that peer left in MessageEvents.onPeerLeft.

        • (): void
        • Leaves the room. This function should be called when user leaves the room in a clean way e.g. by clicking a dedicated, custom button disconnect. As a result there will be generated one more media event that should be sent to the RTC Engine. Thanks to it each other peer will be notified that peer left in MessageEvents.onPeerLeft.

          Returns void

Generated using TypeDoc