コード例 #1
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
            {
                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
            }
        }
コード例 #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());
     });
 }
コード例 #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);
            }
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        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;
            });
        }
コード例 #6
0
        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);
            });
        }
コード例 #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
            }
        }
コード例 #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);
            }
        }
コード例 #9
0
        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;
                });
            }
        }
コード例 #10
0
        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}";
                });
            }
        }
コード例 #11
0
        private async Task JoinChannel()
        {
            var accessToken = await AgoraTokenService.GetRtcToken(ChannelName);

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