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

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

添加的流永遠不會被 agora.io 觸發

添加的流永遠不會被 agora.io 觸發

森欄 2022-08-18 16:40:33
我有:        this.agoraClient = AgoraRTC.createClient({ mode: "rtc", codec: "h264" })        this.agoraClient.on('stream-added', (evt) => {            console.log('SHAMOON added stream', evt)            this.remoteStream = evt.stream            this.agoraClient.subscribe(this.remoteStream)        })        this.agoraClient.on('stream-subscribed', (evt) => {            console.log('SHAMOON subscribed stream', evt)            this.remoteStream.play(this.remoteHtmlElementId, { muted: true });        })        await new Promise((resolve, reject) => this.agoraClient.init(this.appId, resolve, reject))        await new Promise((resolve, reject) => this.agoraClient.join(null, this.channelName, this.uid, resolve, reject))        this.localStream = AgoraRTC.createStream({            streamID: this.uid,            audio: true,            video: false,            screen: false        })        await new Promise(this.localStream.init)        this.localStream.play(this.localHtmlElementId, { muted: true })        console.log('playing local')        this.agoraClient.publish(this.localStream)        console.log('publishing local')它到達了,但永遠不會被調用。我做錯了什么?publishing localSHAMOON added stream
查看完整描述

1 回答

?
有只小跳蛙

TA貢獻1824條經驗 獲得超8個贊

僅當將遠程流添加到通道時,才會觸發回調。要偵聽的事件是將本地流添加到通道時的事件。stream-addedstream-published


this.agoraClient.on('stream-published', function (evt) {

  console.log("local stream published successfully");

});


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

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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