Esempio n. 1
0
        /// <summary>
        /// Starts the session.
        /// </summary>
        /// <param name="sessionId">Session identifier.</param>
        /// <param name="agoraAPI">Agora API key.</param>
        public void StartSession(string sessionId, string agoraAPI, string token, VideoAgoraProfile profile = VideoAgoraProfile.Portrait360P, bool swapWidthAndHeight = false, bool webSdkInteroperability = false)
        {
            _knownStreams.Add(_myId);
            _agoraHandler = new AgoraRtcEngineEventHandler(this);
            _agoraEngine  = RtcEngine.Create(global::Android.App.Application.Context, agoraAPI, _agoraHandler);
            _agoraEngine.EnableWebSdkInteroperability(webSdkInteroperability);
            _agoraEngine.SetChannelProfile(Constants.ChannelProfileCommunication);
            //_agoraEngine.SetVideoProfile(Constants.VideoProfile360p, false); <2.3.0
            _agoraEngine.SetVideoEncoderConfiguration(GetVideoConfig(profile));
            _agoraEngine.EnableLocalVideo(true);
            _agoraEngine.EnableVideo();
            _agoraEngine.SwitchCamera();

            _agoraEngine.SetEnableSpeakerphone(true);
            // if you do not specify the uid, we will generate the uid for you
            _agoraEngine.JoinChannel(token, sessionId, string.Empty, 0);
        }
 /// <summary>
 /// Starts the session.
 /// </summary>
 /// <param name="sessionId">Session identifier.</param>
 /// <param name="agoraAPI">Agora API key.</param>
 public void StartSession(string sessionId, string agoraAPI, VideoAgoraProfile profile = VideoAgoraProfile.Portrait360P, bool swapWidthAndHeight = false, bool webSdkInteroperability = false)
 {
     _knownStreams.Add(_myId);
     _agoraHandler = new AgoraRtcEngineEventHandler(this);
     _agoraEngine  = RtcEngine.Create(global::Android.App.Application.Context, agoraAPI, _agoraHandler);
     _agoraEngine.EnableWebSdkInteroperability(webSdkInteroperability);
     _agoraEngine.SetChannelProfile(Constants.ChannelProfileCommunication);
     _agoraEngine.EnableVideo();
     _agoraEngine.EnableAudio();
     _agoraEngine.SetAudioProfile(1, 2);
     _agoraEngine.EnableDualStreamMode(true);
     _agoraEngine.SetDefaultAudioRoutetoSpeakerphone(true);
     _agoraEngine.SetVideoEncoderConfiguration(BaseVideoEncoding);
     _agoraEngine.SetHighQualityAudioParameters(true, true, true);
     _agoraEngine.EnableLastmileTest();
     // if you do not specify the uid, we will generate the uid for you
     _agoraEngine.JoinChannel(null, sessionId, string.Empty, 0);
 }