private async Task JoinChannel()
        {
            _progressBar.Visibility = ViewStates.Visible;
            var token = await AgoraTokenService.GetRtcToken(AgoraSettings.Current.RoomName);

            if (string.IsNullOrEmpty(token))
            {
                _progressBar.Visibility = ViewStates.Gone;
            }
            else
            {
                IO.Agora.Api.Component.Constant.Engine.SetParameters("{\"che.video.mobile_1080p\":true}");
                IO.Agora.Api.Component.Constant.Engine.SetClientRole(Constants.ClientRoleBroadcaster);

                if (AgoraSettings.Current.Role == AgoraRole.Listener)
                {
                    IO.Agora.Api.Component.Constant.Engine.SetChannelProfile(Constants.ChannelProfileCommunication);
                    IO.Agora.Api.Component.Constant.Engine.MuteLocalVideoStream(true);
                }
                else
                {
                    IO.Agora.Api.Component.Constant.Engine.SetChannelProfile(Constants.ChannelProfileLiveBroadcasting);
                    IO.Agora.Api.Component.Constant.Engine.SetVideoSource(new AgoraDefaultSource());
                }

                IO.Agora.Api.Component.Constant.Engine.EnableVideo();
                IO.Agora.Api.Component.Constant.Engine.JoinChannel(token, AgoraSettings.Current.RoomName, string.Empty, 0); // if you do not specify the uid, we will generate the uid for you
            }
        }
Esempio n. 2
0
 public void StartBroadcast(string channel)
 {
     Task.Run(async() =>
     {
         var token = await AgoraTokenService.GetRtcToken(channel);
         _sharedAgoraEngine.JoinChannelByToken(token, channel, string.Empty, (uint)ExtensionConstants.SCREEN_SHARE_UID, new AgoraRtcChannelMediaOptions());
     });
 }
Esempio n. 3
0
        public async Task TokenPrivilegeWillExpire(AgoraRtcEngineKit engine, string token)
        {
            var newToken = await AgoraTokenService.GetRtcToken(AgoraSettings.Current.RoomName);

            if (!string.IsNullOrEmpty(newToken))
            {
                _agoraKit.RenewToken(newToken);
            }
        }
        public async Task OnTokenPrivilegeWillExpire(string token)
        {
            var newToken = await AgoraTokenService.GetRtcToken(AgoraSettings.Current.RoomName);

            if (!string.IsNullOrEmpty(token))
            {
                IO.Agora.Api.Component.Constant.Engine.RenewToken(newToken);
            }
        }
        private async Task JoinChannel()
        {
            var token = await AgoraTokenService.GetRtcToken(ChannelName);

            _agoraKit.JoinChannelByToken(token, ChannelName, string.Empty, 0, (s, i, k) =>
            {
                _agoraKit.SetEnableSpeakerphone(true);
                UIApplication.SharedApplication.IdleTimerDisabled = true;
            });
        }
        private async Task JoinChannel()
        {
            var token = await AgoraTokenService.GetRtcToken(ChannelName);

            _agoraKit.JoinChannelByToken(token, ChannelName, string.Empty, 0, (s, i, k) =>
            {
                _agoraKit.EnableAudio();
                var devices = _agoraKit.EnumerateDevices(MediaDeviceType.AudioRecording);
                _agoraKit.SetDevice(MediaDeviceType.AudioRecording, devices[0].DeviceId);
            });
        }
Esempio n. 7
0
        private async Task JoinChannel()
        {
            _progressBar.Visibility = ViewStates.Visible;
            var token = await AgoraTokenService.GetRtcToken(AgoraSettings.Current.RoomName);

            if (string.IsNullOrEmpty(token))
            {
                _progressBar.Visibility = ViewStates.Gone;
            }
            else
            {
                AgoraEngine.JoinChannel(token, AgoraSettings.Current.RoomName, string.Empty, 0); // if you do not specify the uid, we will generate the uid for you
            }
        }
Esempio n. 8
0
        private async void JoinRtc()
        {
            LoadingIndicator.Hidden = false;
            var token = await AgoraTokenService.GetRtcToken(AgoraSettings.Current.RoomName);

            if (string.IsNullOrEmpty(token))
            {
                //smth went wrong
                LoadingIndicator.Hidden = true;
            }
            else
            {
                _agoraKit.JoinChannelByToken(token, AgoraSettings.Current.RoomName, null, 0, JoiningCompleted);
            }
        }
        public async Task JoinChannel()
        {
            LoadingIndicator.Hidden = false;
            var token = await AgoraTokenService.GetRtcToken(Channel);

            if (string.IsNullOrEmpty(token))
            {
                LoadingIndicator.Hidden = true;
            }
            else
            {
                _agoraKit.JoinChannelByToken(token, Channel, null, 0, (arg1, arg2, arg3) =>
                {
                    LoadingIndicator.Hidden = true;
                });
            }
        }
        public async Task JoinChannel()
        {
            var dataSource = new RemoteVideosTableDataSource(_users);

            RemoteUsersTableView.DataSource = dataSource;
            RemoteUsersTableView.Delegate   = new RemoteVideosTableDelegate(dataSource, _agoraKit);

            LoadingIndicator.Hidden = false;
            var token = await AgoraTokenService.GetRtcToken(Channel);

            if (string.IsNullOrEmpty(token))
            {
                LoadingIndicator.Hidden = true;
            }
            else
            {
                _agoraKit.JoinChannelByToken(token, Channel, null, 0, (arg1, arg2, arg3) =>
                {
                    LoadingIndicator.Hidden = true;
                    _localId = (uint)arg2;
                    roomNameLabel.StringValue = $"Room name: {Channel}";
                });
            }
        }
Esempio n. 11
0
        private async Task JoinChannel()
        {
            var accessToken = await AgoraTokenService.GetRtcToken(ChannelName);

            _rtcEngine.JoinChannel(accessToken, ChannelName, string.Empty, 0);
        }