void JoinChannel(string channelName) { if (VideoShareEngine.mRtcEngine == null) { if (ToastManager.instance) { ToastManager.instance.AddToast(ToastType.Error, "mRtcEngine 为空"); } return; } // 启用视频模块。 VideoShareEngine.EnableVideo(); // 启用视频观测器。 VideoShareEngine.mRtcEngine.EnableVideoObserver(); // set callbacks (optional) VideoShareEngine.mRtcEngine.OnJoinChannelSuccess = onJoinChannelSuccess; VideoShareEngine.mRtcEngine.OnUserJoined = onUserJoined; VideoShareEngine.mRtcEngine.OnUserOffline = onUserOffline; VideoShareEngine.mRtcEngine.OnReJoinChannelSuccess = onReJoinChannelSuccess; VideoShareEngine.mRtcEngine.OnRemoteVideoStateChanged = onRemoteVideoStateChanged; // join channel int tt = VideoShareEngine.mRtcEngine.JoinChannel(channelName, null, 0); if (ToastManager.instance) { ToastManager.instance.AddToast(ToastType.Other, "加入频道返回:" + tt); } // Optional: if a data stream is required, here is a good place to create it int streamID = VideoShareEngine.mRtcEngine.CreateDataStream(true, true); Debug.Log("initializeEngine done, data stream id = " + streamID); }
public void leave() { Debug.Log("calling leave"); VideoShareEngine.leave(); //返回主场景 if (TelentDrawController.instance) { TelentDrawController.instance.LoadGame("Main"); } }
public void EnableVideo(bool pauseVideo) { if (!pauseVideo) { VideoShareEngine.EnableVideo(); } else { VideoShareEngine.DisableVideo(); } }
public void SetMuteLocalAudio() { int temp = VideoShareEngine.MuteLocalAudio(); if (temp == 0) { if (ToastManager.instance) { ToastManager.instance.AddToast(ToastType.Info, "操作成功"); } } else { if (ToastManager.instance) { ToastManager.instance.AddToast(ToastType.Error, "操作失败"); } } }
// unload agora engine public void unloadEngine() { Debug.Log("calling unloadEngine"); VideoShareEngine.unloadEngine(); }