亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

獲取服務器節點失敗 [CANNOT_MEET_AREA_DEMAND]

獲取服務器節點失敗 [CANNOT_MEET_AREA_DEMAND]

天涯盡頭無女友 2023-03-18 17:28:00
我可以使用來自 agora.io 的臨時令牌進行基本視頻通話,但是當我從我的服務器創建令牌時,出現此錯誤。我正在使用 NgxAgora 數據包。我嘗試設置區號,但在 NgxAgora 中沒有此選項。這是我的角度代碼: this.api.getmethod("appointment/gettoken/" + atob(this.acRouter.snapshot.params.id)).subscribe((data) => {    this.token = data['token']    this.client = this.ngxAgoraService.createClient({ mode: 'rtc', codec: 'h264' });           this.assignClientHandlers();      this.localStream = this.ngxAgoraService.createStream({ streamID: this.uid, audio: true, video: true, screen: false });    this.assignLocalStreamHandlers();    // Join and publish methods added in this step    this.initLocalStream(() => this.join(uid => this.publish(), error => console.error(error)));  })我使用 C# 在 web api 端使用這個函數: public string createagoratoken(string appointmentUid,DateTime appointmentDate,int appointmentId)    {        var tokenbuilder = new AgoraEntegration.Media.AccessToken(AgoraEntegration.AgoraEnums.AppEnums.appId, AgoraEntegration.AgoraEnums.AppEnums.appCertificate, appointmentUid, appointmentId.ToString());        appointmentDate = appointmentDate.AddMinutes(20);                            Int32 unixTimestamp = (Int32)(appointmentDate.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;        tokenbuilder.addPrivilege(AgoraEntegration.Media.Privileges.kJoinChannel, (uint)unixTimestamp);        tokenbuilder.addPrivilege(AgoraEntegration.Media.Privileges.kInvitePublishAudioStream, (uint)unixTimestamp);        tokenbuilder.addPrivilege(AgoraEntegration.Media.Privileges.kInvitePublishVideoStream,(uint)unixTimestamp);        string token = tokenbuilder.build();        return token;    }我還使用這個庫作為 C# 的訪問令牌 Github 訪問令牌
查看完整描述

1 回答

?
隔江千里

TA貢獻1906條經驗 獲得超10個贊

CANNOT_MEET_AREA_DEMAND通常出現在以下情況:連接失敗,因為用戶不在選擇的連接區域。比如你設置ClientConfig.areaCode為[AgoraRTC.AREAS.EUROPE],北美的用戶嘗試加入頻道,就會出現這個錯誤。如果不顯式設置ClientConfig.areaCode,SDK會默認請求跨地域的服務器,并選擇最優連接,所以當用戶加入頻道時控制臺日志可能會打印此錯誤。在這種情況下,您可以忽略該錯誤。


嘗試將 areaCode 設置為 GLOBAL:


this.rtc = AgoraRTC.createClient({

  //

  areaCode: ['GLOBAL']

});


查看完整回答
反對 回復 2023-03-18
  • 1 回答
  • 0 關注
  • 164 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號