Created
August 20, 2020 00:56
-
-
Save icywind/d50528dc216eca75508c20833815e79a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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