Inheritance: IRtcEngineEventHandler
コード例 #1
0
 protected override void OnDestroy()
 {
     if (AgoraHandler != null)
     {
         AgoraHandler.Dispose();
         AgoraHandler = null;
     }
     if (AgoraEngine != null)
     {
         AgoraEngine.Dispose();
         AgoraEngine = null;
     }
     base.OnDestroy();
 }
コード例 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Join);
            _layout = FindViewById(Resource.Id.joinLayout);
            CheckPermissions();
            FindViewById <EditText>(Resource.Id.channelName).Text   = AgoraSettings.Current.RoomName;
            FindViewById <EditText>(Resource.Id.encryptionKey).Text = AgoraSettings.Current.EncryptionPhrase;
            AgoraHandler = new AgoraQualityHandler(this);
            AgoraEngine  = RtcEngine.Create(BaseContext, AgoraTestConstants.AgoraAPI, AgoraHandler);
            AgoraEngine.EnableWebSdkInteroperability(true);
            AgoraEngine.EnableLastmileTest();
            FindViewById <TextView>(Resource.Id.agora_version_text).Text = string.Format(VersionFormat, RtcEngine.SdkVersion);
            var listenerRadioBtn = FindViewById <RadioButton>(Resource.Id.roleListener);

            listenerRadioBtn.Checked = AgoraSettings.Current.Role == AgoraRole.Listener;
            listenerRadioBtn.Click  += OnRadioButtonClicked;

            var broadcasterRadioBtn = FindViewById <RadioButton>(Resource.Id.roleBroadcaster);

            broadcasterRadioBtn.Checked = AgoraSettings.Current.Role == AgoraRole.Broadcaster;
            broadcasterRadioBtn.Click  += OnRadioButtonClicked;
        }