Преглед изворни кода

Call leaveVideoVisitAsPro when pro hangs up

Vijayakrishnan Krishnan пре 5 година
родитељ
комит
3de56a7a5f
1 измењених фајлова са 8 додато и 14 уклоњено
  1. 8 14
      resources/views/pro-call.blade.php

+ 8 - 14
resources/views/pro-call.blade.php

@@ -146,6 +146,11 @@
                         this.startTime = false;
                         this.videoActive = false;
                         // this.client = false;
+
+                        // call leaveVideoVisitAsPro
+                        $.post('/api/clientVideoVisit/leaveVideoVisitAsPro', {}, function(_data) {
+                            console.log(_data);
+                        });
                     }
                 },
                 initOpenTok: function() {
@@ -175,9 +180,6 @@
                     var sessionId = this.otSessionId;
                     var token = this.selfToken;
 
-                    // destroy if existing
-                    // self.hangUp();
-
                     self.otSession = OT.initSession(apiKey, sessionId);
 
                     // peer connected
@@ -270,18 +272,8 @@
 
                         // if no other parties in call, hang up
                         if(!$('[data-stream]:not([data-stream="' + self.selfStreamId + '"])').length) {
-                            // self.hangUp();
-                            console.warn('No other parties in the call!');
-                            // new Noty({
-                            //     theme: 'mint',
-                            //     type: 'info',
-                            //     text: 'All other participants have left the call',
-                            //     progressBar: false,
-                            //     timeout: 2500,
-                            // }).show();
                             self.startTime = 0;
                             self.started = false;
-                            // self.hangUp();
                             self.noOneElseInCall = true;
                         }
                     }
@@ -359,7 +351,9 @@
                             });
                         }
                         else {
-                            self.hangUp();
+                            self.startTime = 0;
+                            self.started = false;
+                            self.noOneElseInCall = true;
                         }
 
                         // turn pro video off