JCClient.Callback

public interface Callback

JumpChat callback interface for JCClient. Application should implement this interface to provide to the JCClient constructor.

Methods

onDCBroadcastState

void onDCBroadcastState(String userid, Boolean video, Boolean audio)

Received a user broadcasting a state change.

Parameters:
  • userid – User id of the state change
  • videotrue if video is available, false otherwise
  • audiotrue if audio is available, false otherwise

onDCDataMessage

void onDCDataMessage(String userid, JSONObject msg)

Received a custom data message from user.

Parameters:
  • userid – User id of the sender
  • msg – JSON object of the message

onDCJoined

void onDCJoined(String userid)

Called when a user has joined.

Parameters:
  • userid – User id of person joining the room

onDCTextMessage

void onDCTextMessage(String userid, String msg)

Received a text message from a user.

Parameters:
  • userid – User id of the sender
  • msg – Text message sent

onDCUpdateAvatar

void onDCUpdateAvatar(String userid, Bitmap avatar)

Received a user avatar change.

Parameters:
  • userid – User id of the avatar change
  • avatar – Updated avatar

onDCUpdateName

void onDCUpdateName(String userid, String name)

Received a user name change.

Parameters:
  • userid – User id of the name change
  • name – Updated name of the user

onJoinFailed

void onJoinFailed(String roomName)

Called when joining a room fails.

Parameters:
  • roomName – Name of the room

onJoined

void onJoined()

Called when user successfully joins a room.

onKicked

void onKicked()

Called when admin has kicked the user.

onKnocking

void onKnocking(String sessid, String msg)

Called when someone is knocking to request joining a room.

Parameters:
  • sessid – Session id describing the user knocking
  • msg – Message that can be displayed created by the user knocking

onRoomCreated

void onRoomCreated(String roomName)

Called when a room create request is processed.

Parameters:
  • roomName – Name of the created room

onRoomInfoUpdated

void onRoomInfoUpdated()

Called when the room information has been updated. For example, when someone is knocking on the room. This is only called when user is the admin.

onSetVideoSize

void onSetVideoSize(String userid, String videoid, int width, int height)

Called when the video size of a stream changes.

Parameters:
  • userid – User id of the video owner
  • videoid – Video id of the change stream
  • width – Updated width of the stream
  • height – Updated height of the stream

onSocketError

void onSocketError(Exception e)

Called when the server connection fails.

Parameters:
  • e – Exception describing the error

onUsersUpdated

void onUsersUpdated()

Called when someone joins or leaves the room.

onVersionCheck

void onVersionCheck(String version)

Called after a version check query is done for the client.

Parameters:
  • version – Version returned. Empty string if version check failed.

onVideoAdded

void onVideoAdded(String userid, String videoid, JCVideoView view)

Called when a video of a user is added.

Parameters:
  • userid – User id of the owner of the video
  • videoid – Unique video id
  • view – Video view

onVideoRemoved

void onVideoRemoved(String userid, String videoid)

Called when a video of a user is removed.

Parameters:
  • userid – User id of the owner of the video
  • videoid – Unique video id