fix: Android进入会议没有声音的问题

This commit is contained in:
kuaifan 2022-11-10 22:45:54 +08:00
parent b556c3ba6c
commit efcaabbbd8

View File

@ -149,6 +149,7 @@ export default {
agoraClient: null, agoraClient: null,
remoteUsers: [], remoteUsers: [],
readyPlay: [],
localUser: { localUser: {
uid: null, uid: null,
audioTrack: null, audioTrack: null,
@ -352,11 +353,14 @@ export default {
this.loadIng--; this.loadIng--;
this.addShow = false; this.addShow = false;
this.meetingShow = true; this.meetingShow = true;
if (this.addData.tracks.includes("video")) { this.$nextTick(_ => {
this.$nextTick(_ => { if (this.addData.tracks.includes("video")) {
this.$refs[`meeting_${this.localUser.uid}`].play('video') this.$refs[`meeting_${this.localUser.uid}`].play('video')
}
this.readyPlay.forEach(item => {
this.$refs[`meeting_${item.uid}`][0].play(item.mediaType)
}) })
} })
}, },
async leave() { async leave() {
@ -437,7 +441,11 @@ export default {
const index = this.remoteUsers.findIndex(item => item.uid == user.uid) const index = this.remoteUsers.findIndex(item => item.uid == user.uid)
if (index > -1) { if (index > -1) {
await this.agoraClient.subscribe(user, mediaType); await this.agoraClient.subscribe(user, mediaType);
this.$refs[`meeting_${user.uid}`][0].play(mediaType) if (this.$refs[`meeting_${user.uid}`]) {
this.$refs[`meeting_${user.uid}`][0].play(mediaType)
} else {
this.readyPlay.push({uid: user.uid, mediaType})
}
} }
}, },