Kaynağa Gözat

If the participant who left is in center view, show self in center view

Vijayakrishnan 4 yıl önce
ebeveyn
işleme
75d981cf80

+ 10 - 0
resources/views/app/video/call-agora-v2.blade.php

@@ -397,6 +397,16 @@
                             if(message && message.body) {
                                 let eventData = JSON.parse(message.body);
                                 if(!_isSelf(eventData) && eventData.data) {
+
+                                    // if the participant who left is in center view, switch center view to self
+                                    for (let i = 0; i < this.otherParticipants.length; i++) {
+                                        if (this.otherParticipants[i].uid === eventData.performer) {
+                                            if(this.mainViewParticipant.uid === (+this.otherParticipants[i].mediaServiceIdentifier)) {
+                                                this.showInCenterView(true, this.myMediaServiceIdentifier, 'You', 'PRO');
+                                            }
+                                        }
+                                    }
+
                                     this.otherParticipants = this.otherParticipants.filter(_participant => {
                                          return _participant.uid !== eventData.performer;
                                     });