ソースを参照

Auto hangup any previous meeting when starting a new one

Vijayakrishnan 4 年 前
コミット
7efa2ab64b
1 ファイル変更11 行追加6 行削除
  1. 11 6
      resources/views/app/video/call-agora-v2.blade.php

+ 11 - 6
resources/views/app/video/call-agora-v2.blade.php

@@ -236,12 +236,17 @@
                     // start: main flow
                     enterClientRoomAsPro: function() {
                         @if($client)
-                            $.post('/api/meeting/enterClientRoomAsPro', {clientUid: '{{ $client->uid }}'}, (_data) => {
-                                if(!this.hasError(_data)) {
-                                    this.appMode = 'video';
-                                    this.getMeetingInfo(true);
-                                }
-                            });
+                            this.socketClient.send("/app/leaveClientRoom", {},
+                                JSON.stringify({sessionKey: '{{$performer->session_key}}'})
+                            );
+                            window.setTimeout(() => {
+                                $.post('/api/meeting/enterClientRoomAsPro', {clientUid: '{{ $client->uid }}'}, (_data) => {
+                                    if(!this.hasError(_data)) {
+                                        this.appMode = 'video';
+                                        this.getMeetingInfo(true);
+                                    }
+                                });
+                            }, 250);
                         @endif
                     },
                     getMeetingInfo: function(_firstRun = false) {