|
@@ -90,7 +90,7 @@ export default {
|
|
},
|
|
},
|
|
getToken() {
|
|
getToken() {
|
|
$.ajax({
|
|
$.ajax({
|
|
- url: "/post-to-api",
|
|
|
|
|
|
+ url: "/post-to-api-ajax",
|
|
method: "POST",
|
|
method: "POST",
|
|
headers: {
|
|
headers: {
|
|
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
|
|
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
|
|
@@ -224,12 +224,7 @@ export default {
|
|
sessionDisconnected: event => {
|
|
sessionDisconnected: event => {
|
|
if (event.reason === "forceDisconnected") {
|
|
if (event.reason === "forceDisconnected") {
|
|
alert("You were kicked.");
|
|
alert("You were kicked.");
|
|
- if (this.user.type === "associate") {
|
|
|
|
- this.disconnect();
|
|
|
|
- this.$store.dispatch("leaveMeeting");
|
|
|
|
- } else {
|
|
|
|
- window.location = "/";
|
|
|
|
- }
|
|
|
|
|
|
+ this.$store.dispatch("leaveMeeting");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -416,20 +411,21 @@ export default {
|
|
},
|
|
},
|
|
kickParcitipantContinue(participant) {
|
|
kickParcitipantContinue(participant) {
|
|
const connection = participant.video.obj.stream.connection;
|
|
const connection = participant.video.obj.stream.connection;
|
|
- const [type, id] = connection.data.split(":");
|
|
|
|
|
|
+ const id = connection.data;
|
|
this.openTokSession.forceDisconnect(connection, error => {
|
|
this.openTokSession.forceDisconnect(connection, error => {
|
|
if (error) {
|
|
if (error) {
|
|
console.error(error);
|
|
console.error(error);
|
|
} else {
|
|
} else {
|
|
$.ajax({
|
|
$.ajax({
|
|
- url: `/associate/meeting/${this.meeting.id}/kick`,
|
|
|
|
|
|
+ url: "/post-to-api-ajax",
|
|
method: "POST",
|
|
method: "POST",
|
|
headers: {
|
|
headers: {
|
|
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
|
|
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
|
|
},
|
|
},
|
|
data: {
|
|
data: {
|
|
- type,
|
|
|
|
- id
|
|
|
|
|
|
+ _api: "/api/meeting/kick",
|
|
|
|
+ uid: this.meeting.uid,
|
|
|
|
+ participantUid: id
|
|
},
|
|
},
|
|
error: jXhr => {
|
|
error: jXhr => {
|
|
console.error(getSingleError(jXhr));
|
|
console.error(getSingleError(jXhr));
|
|
@@ -440,6 +436,22 @@ export default {
|
|
},
|
|
},
|
|
kickParcitipant(participant) {
|
|
kickParcitipant(participant) {
|
|
if (confirm("Are you sure want to kick this person out of meeting?")) this.kickParcitipantContinue(participant);
|
|
if (confirm("Are you sure want to kick this person out of meeting?")) this.kickParcitipantContinue(participant);
|
|
|
|
+ },
|
|
|
|
+ leaveMeeting() {
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: "/post-to-api-ajax",
|
|
|
|
+ method: "POST",
|
|
|
|
+ headers: {
|
|
|
|
+ "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
|
|
|
|
+ },
|
|
|
|
+ data: {
|
|
|
|
+ _api: "/api/meeting/leave"
|
|
|
|
+ },
|
|
|
|
+ error: jXhr => {
|
|
|
|
+ console.error(getSingleError(jXhr));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.$store.dispatch("leaveMeeting");
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -462,6 +474,7 @@ export default {
|
|
if (val) {
|
|
if (val) {
|
|
this.getToken();
|
|
this.getToken();
|
|
} else {
|
|
} else {
|
|
|
|
+ this.disconnect();
|
|
this.loadingInProgress = false;
|
|
this.loadingInProgress = false;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -498,20 +511,7 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- this.$eventBus.$on("leaveMeeting", () => {
|
|
|
|
- // $.ajax({
|
|
|
|
- // url: "/associate/meeting/leave",
|
|
|
|
- // method: "POST",
|
|
|
|
- // headers: {
|
|
|
|
- // "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content")
|
|
|
|
- // },
|
|
|
|
- // error: jXhr => {
|
|
|
|
- // console.error(getSingleError(jXhr));
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- this.$store.dispatch("leaveMeeting");
|
|
|
|
- this.disconnect();
|
|
|
|
- });
|
|
|
|
|
|
+ this.$eventBus.$on("leaveMeeting", this.leaveMeeting);
|
|
|
|
|
|
if (this.meeting.uid) {
|
|
if (this.meeting.uid) {
|
|
this.getToken();
|
|
this.getToken();
|