|
@@ -154,13 +154,13 @@ export class MessageService {
|
|
|
/* 呼叫事件 */
|
|
|
async callPresence(message: string, publisher: string, channelName: string) {
|
|
|
let userData = await this.getUserMetadata(publisher);
|
|
|
- console.log('发出消息用户:', userData);
|
|
|
+ console.log('向我发出事件用户:', userData);
|
|
|
let toast;
|
|
|
if (message.indexOf('ONUSERSENDGIFT_') > -1) {
|
|
|
let arr = message.split('_');
|
|
|
- // let gift = this.giftList.find((item: any) => item.id == arr[1]);
|
|
|
- let r = await this.aiServ.getGift(undefined,arr[1])
|
|
|
- let gift = r[0]
|
|
|
+ let gift = this.giftList.find((item: any) => item.id == arr[1]);
|
|
|
+ // let r = await this.aiServ.getGift(undefined,arr[1])
|
|
|
+ // let gift = r[0]
|
|
|
this.giftLogMap.push({
|
|
|
gift,
|
|
|
count: arr?.[2],
|
|
@@ -168,7 +168,11 @@ export class MessageService {
|
|
|
});
|
|
|
!this.isPlayer && setTimeout(() => {
|
|
|
// this.playGift(this.giftLogMap.slice(-1)[0]);
|
|
|
- this.eventplay.next(this.giftLogMap.slice(-1)[0]);
|
|
|
+ let obj = this.giftLogMap.slice(-1)[0]
|
|
|
+ this.eventplay.next({
|
|
|
+ video: obj.gift.video,
|
|
|
+ config: obj.gift.config,
|
|
|
+ });
|
|
|
}, 0);
|
|
|
return;
|
|
|
}
|
|
@@ -201,7 +205,7 @@ export class MessageService {
|
|
|
switch (message) {
|
|
|
case 'USERCALLINVITATION':
|
|
|
await this.setConnectState(this.userId, 'CONNECTING');
|
|
|
- console.log(`收到${userData?.nickname?.value ?? '未知用户'}通话邀请`);
|
|
|
+ // console.log(`收到${userData?.nickname?.value ?? '未知用户'}通话邀请`);
|
|
|
this.alert = await this.alertController.create({
|
|
|
cssClass: 'my-custom-class',
|
|
|
header: '通话邀请',
|
|
@@ -237,7 +241,7 @@ export class MessageService {
|
|
|
break;
|
|
|
case 'CLOASEINVITATION':
|
|
|
await this.setConnectState(this.userId, 'ONLINE');
|
|
|
- console.log(`${userData?.nickname?.value ?? '未知用户'}取消通话`);
|
|
|
+ // console.log(`${userData?.nickname?.value ?? '未知用户'}取消通话`);
|
|
|
this.alert?.dismiss();
|
|
|
toast = await this.toastController.create({
|
|
|
message: '对方已取消通话邀请',
|
|
@@ -247,14 +251,12 @@ export class MessageService {
|
|
|
toast.present();
|
|
|
break;
|
|
|
case 'REFUSEINVITATION_' + this.userId:
|
|
|
- console.log(`${userData?.nickname?.value ?? '未知用户'}拒绝通话`);
|
|
|
+ // console.log(`${userData?.nickname?.value ?? '未知用户'}拒绝通话`);
|
|
|
this.alert?.dismiss();
|
|
|
this.eventSource.next(false);
|
|
|
break;
|
|
|
case 'RESPONSEINVITOIN_' + this.userId:
|
|
|
- console.log(
|
|
|
- `${userData?.nickname?.value ?? '未知用户'}同意通话,进入视频通话`
|
|
|
- );
|
|
|
+ // console.log(`${userData?.nickname?.value ?? '未知用户'}同意通话,进入视频通话`);
|
|
|
this.alert?.dismiss();
|
|
|
this.eventSource.next(true);
|
|
|
break;
|