// load agora engine public void loadEngine() { // start sdk logAPICall("initializeEngine"); if (mRtcEngine != null) { logAPICall("Engine exists. Please unload it first!"); return; } // init engine mRtcEngine = IRtcEngine.getEngine(mVendorKey); videoRawDataManager = VideoRawDataManager.GetInstance(mRtcEngine); mRtcEngine.EnableVideo(); mRtcEngine.EnableVideoObserver(); mRtcEngine.SetLogFile("/sdcard/test.agora.zhang/agora_sdk.log"); mRtcEngine.SetParameters("{\"rtc.log_filter\": 65535}"); mRtcEngine.SetVideoProfile(VIDEO_PROFILE_TYPE.VIDEO_PROFILE_PORTRAIT_480P_6, true); audioPlaybackDeviceManager = AudioPlaybackDeviceManager.GetInstance(mRtcEngine); audioRecordingoDeviceManager = AudioRecordingDeviceManager.GetInstance(mRtcEngine); videoDeviceManager = VideoDeviceManager.GetInstance(mRtcEngine); metaDataObserver = MetadataObserver.GetInstance(mRtcEngine); packetObserver = PacketObserver.GetInstance(mRtcEngine); audioRawDataManager = AudioRawDataManager.GetInstance(mRtcEngine); videoRawDataManager = VideoRawDataManager.GetInstance(mRtcEngine); // enable log mRtcEngine.SetLogFilter(LOG_FILTER.DEBUG | LOG_FILTER.INFO | LOG_FILTER.WARNING | LOG_FILTER.ERROR | LOG_FILTER.CRITICAL); }
void OnJoinChannelSuccessHandler(string channelName, uint uid, int elapsed) { Debug.Log("JoinChannelSuccessHandler: uid = " + uid); localVideoImage.AddComponent <VideoSurface>(); // Get the name name of your machine's microphone to display in the bottom panel string audioDeviceName = "null"; string audioDeviceID = "null"; AudioRecordingDeviceManager.GetInstance(AgoraJoin.mRtcEngine).CreateAAudioRecordingDeviceManager(); AudioRecordingDeviceManager.GetInstance(AgoraJoin.mRtcEngine).GetCurrentRecordingDeviceInfo(ref audioDeviceName, ref audioDeviceID); audioDeviceText.text = audioDeviceName; // Get the name of your machine's webcam to display string videoDeviceName = "null"; string videoDeviceID = "null"; VideoDeviceManager.GetInstance(AgoraJoin.mRtcEngine).CreateAVideoDeviceManager(); VideoDeviceManager.GetInstance(AgoraJoin.mRtcEngine).GetVideoDevice(0, ref videoDeviceName, ref videoDeviceID); videoDeviceText.text = videoDeviceName; // Set user name to name on the top panel channelIDText.text = channelName; isLocalVideoEnabled = true; }