Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
void OnJoinChannelSuccessHandler(string channelName, uint uid, int elapsed)
{
// can add other logics here, for now just print to the log
Debug.LogFormat("Joined channel {0} successful, my uid = {1}", channelName, uid);
}
void OnLeaveChannelHandler(RtcStats stats)
{
myView.SetEnable(false);
if (remoteView != null)
{
remoteView.SetEnable(false);
}
}
void OnUserJoined(uint uid, int elapsed)
{
GameObject go = GameObject.Find("RemoteView");
if (remoteView == null)
{
remoteView = go.AddComponent<VideoSurface>();
}
remoteView.SetForUser(uid);
remoteView.SetEnable(true);
remoteView.SetVideoSurfaceType(AgoraVideoSurfaceType.RawImage);
remoteView.SetGameFps(30);
}
void OnUserOffline(uint uid, USER_OFFLINE_REASON reason)
{
remoteView.SetEnable(false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.