Przeglądaj źródła

Fix case when assistant/mcp hangs up first

Vijayakrishnan Krishnan 5 lat temu
rodzic
commit
c965085f6e
1 zmienionych plików z 15 dodań i 9 usunięć
  1. 15 9
      resources/views/meet.blade.php

+ 15 - 9
resources/views/meet.blade.php

@@ -1,3 +1,4 @@
+<?= /** @var $guest */ ?>
 @extends('layouts.meeting')
 @section('content')
 
@@ -175,7 +176,7 @@
                     // put client in mcp queue
                     $.ajax({
                         type: 'post',
-                        url: '/api/clientVideoVisit/PutVideoVisitInMcpQueue',
+                        url: '/api/clientVideoVisit/putVideoVisitInMcpQueue',
                         headers: {
                             'sessionKey': localStorage.sessionKey
                         },
@@ -290,17 +291,19 @@
 
                     // peer disconnected
                     self.otSession.on("streamDestroyed", function(event) {
-                        console.log('streamDestroyed from ' + event.target.connection.data);
+                        console.log('streamDestroyed from ' + event.stream.connection.data);
                         onPeerDisconnection(event, event.stream.connection.data);
                     });
-                    self.otSession.on("connectionDestroyed", function(event) {
-                        console.log('connectionDestroyed from ' + event.connection.data);
-                        onPeerDisconnection(event, event.connection.data);
-                    });
+                    // self.otSession.on("connectionDestroyed", function(event) {
+                    //     debugger;
+                    //     console.log('connectionDestroyed from ' + event.connection.data);
+                    //     onPeerDisconnection(event, event.connection.data);
+                    // });
 
                     function onPeerDisconnection(event, data) {
-                        self.activateParty('self');
-
+                        if(event.stream && $('.full-view[data-stream="' + event.stream.id + '"]').length) {
+                            self.activateParty('self');
+                        }
                         @if(!$guest)
                         if(data.split('|')[1] === 'CLIENT') {
                             self.hangUp();
@@ -313,12 +316,15 @@
                                 remoteViewElem.attr('data-stream', '');
                                 remoteViewElem.attr('data-from', '');
                             }
+                            remoteViewElem.addClass('disconnected-view')
                         }
 
                         @if($guest)
-                            self.pro = false;
+                        self.pro = false;
                         @else
+                        if(data.split('|')[1] === 'CLIENT') {
                             self.client = false;
+                        }
                         @endif
 
                         // if no other parties in call, hang up