Suggestions

close search

StringeeRoom

Represents a room. Used to manager room, receives the room's events.

Properties

roomId: string

Id of the room.

recorded: boolean

Checks whether the room is recorded.

Events

didJoinRoom : Function(user: StringeeRoomUser)

Invoked when new user join room:
- user: It's the user of room.

didLeaveRoom : Function(user: StringeeRoomUser)

Invoked when the user leave room:
- user: It's the user of room.

didAddVideoTrack : Function(videoTrack: StringeeVideoTrack)

Invoked when add video track to the room:
- videoTrack: It's the video track of room.

didRemoveVideoTrack : Function(videoTrack: StringeeVideoTrack)

Invoked when remove video track from the room:
- videoTrack: It's the video track of room.

didReceiveRoomMessage : Function(msg: JSON, from: StringeeRoomUser)

Invoked when get message in the room:
- from: It's the user who send message.
- msg: The message which is send to the room.

Functions

publish(videoTrack: StringeeVideoTrack, callback: (status, code, message, videoTrack))

Publish video track to room.
- videoTrack: Your video track.
- callback: The result
    + status = true, code = 0, message = "Success"
    + status = false, code = -1, message = "StringeeClient is not initialized or connected".
    + status = false, code = -2, message = "Generic error".
    + videoTrack: A StringeeVideoTrack published to room.

unpublish(videoTrack: StringeeVideoTrack, callback: (status, code, message))

Unpublish video track from room.
- videoTrack: Your video track.
- callback: The result
    + status = true, code = 0, message = "Success"
    + status = false, code = -1, message = "StringeeClient is not initialized or connected".
    + status = false, code = -2, message = "Generic error".

subscribe(videoTrack: StringeeVideoTrack, options: StringeeVideoTrackOption, callback: (status, code, message))

Subscribe video track in room:
- videoTrack: The video track of other user.
- options : track's options.
- callback: The result:
    + status = true, code = 0, message = "Register successfully."
    + status = false, code = -1, message = "StringeeClient is not initialized or connected".
    + status = false, code = -2, message = "Generic error".

unsubscribe(videoTrack: StringeeVideoTrack, callback: (status, code, message))

Unsubscribe video track in room:
- videoTrack: The video track of other user.
- callback: The result:
    + status = true, code = 0, message = "Register successfully."
    + status = false, code = -1, message = "StringeeClient is not initialized or connected".
    + status = false, code = -2, message = "Generic error".

leave(allClient: boolean, callback: (status, code, message))

Leave room:
- allClient:
    + true: All same client id will leave.
    + false: Only client in your device leave.
- callback: The result
    + status = true, code = 0, message = "Success"
    + status = false, code = -1, message = "StringeeClient is not initialized or connected".
    + status = false, code = -2, message = "Generic error".

sendMessage(msg: string, callback: (status, code, message))

Send any message to room.
- msg: JSON Message in type string
- callback: The result
    + status = true, code = 0, message = "Success"
    + status = false, code = -1, message = "StringeeClient is not initialized or connected".
    + status = false, code = -2, message = "Generic error".

close()

Close event stream.