我可以使用來自 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 訪問令牌
獲取服務器節點失敗 [CANNOT_MEET_AREA_DEMAND]
天涯盡頭無女友
2023-03-18 17:28:00