|
@@ -233,7 +233,7 @@ export class LiveService {
|
|
console.log('remoteUsers', user.uid);
|
|
console.log('remoteUsers', user.uid);
|
|
this.client.subscribe(user, 'audio').then((audioTrack: any) => {
|
|
this.client.subscribe(user, 'audio').then((audioTrack: any) => {
|
|
this.user_published_list.add(user);
|
|
this.user_published_list.add(user);
|
|
- audioTrack.setVolume(0);
|
|
|
|
|
|
+ audioTrack.setVolume(100);
|
|
audioTrack.play();
|
|
audioTrack.play();
|
|
});
|
|
});
|
|
this.client.subscribe(user, 'video').then((videoTrack: any) => {
|
|
this.client.subscribe(user, 'video').then((videoTrack: any) => {
|
|
@@ -334,10 +334,12 @@ export class LiveService {
|
|
async afterJoin() {
|
|
async afterJoin() {
|
|
this.timer && clearTimeout(this.timer);
|
|
this.timer && clearTimeout(this.timer);
|
|
this.timer_countdown && clearInterval(this.timer_countdown);
|
|
this.timer_countdown && clearInterval(this.timer_countdown);
|
|
- if (this.client.remoteUsers.length > 0) {
|
|
|
|
|
|
+ const targetUser = this.client.remoteUsers?.find((user: any) => user.uid !== 100001) //排出超管
|
|
|
|
+ console.log(targetUser);
|
|
|
|
+ if (this.client.remoteUsers.length > 0 && targetUser) {
|
|
if (this.isAnchor) {
|
|
if (this.isAnchor) {
|
|
//如果是主播,进入获取remoteUsers.user获取livelog再获取对方剩余通话时长
|
|
//如果是主播,进入获取remoteUsers.user获取livelog再获取对方剩余通话时长
|
|
- this.getLiveLog();
|
|
|
|
|
|
+ this.getLiveLog(targetUser.id);
|
|
} else {
|
|
} else {
|
|
let query = new Parse.Query('LiveLog');
|
|
let query = new Parse.Query('LiveLog');
|
|
query.equalTo('objectId', this.liveLog?.id);
|
|
query.equalTo('objectId', this.liveLog?.id);
|
|
@@ -361,11 +363,11 @@ export class LiveService {
|
|
}, 1000);
|
|
}, 1000);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- async getLiveLog() {
|
|
|
|
- let uid = this.client.remoteUsers[0].uid;
|
|
|
|
|
|
+ async getLiveLog(tarUid:string) {
|
|
|
|
+ // let uid = this.client.remoteUsers[0].uid;
|
|
this.timer && clearTimeout(this.timer);
|
|
this.timer && clearTimeout(this.timer);
|
|
let query = new Parse.Query('LiveLog');
|
|
let query = new Parse.Query('LiveLog');
|
|
- query.equalTo('uid', String(uid));
|
|
|
|
|
|
+ query.equalTo('uid', String(tarUid));
|
|
query.equalTo('room', this.room?.id);
|
|
query.equalTo('room', this.room?.id);
|
|
query.notEqualTo('isDeleted', true);
|
|
query.notEqualTo('isDeleted', true);
|
|
query.notEqualTo('isLive', true);
|
|
query.notEqualTo('isLive', true);
|
|
@@ -378,7 +380,7 @@ export class LiveService {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
this.timer = setTimeout(() => {
|
|
this.timer = setTimeout(() => {
|
|
- this.getLiveLog();
|
|
|
|
|
|
+ this.getLiveLog(tarUid);
|
|
}, 1000);
|
|
}, 1000);
|
|
}
|
|
}
|
|
async get_duration() {
|
|
async get_duration() {
|