Commit 46997790de2e92b1d1d6b4879a0e64553e39fa1f
1 parent
92c6232a67
Exists in
master
and in
2 other branches
remove join session button while video is running
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
src/pages/Dashboard/LiveOnlineClass.vue
1 | <template> | 1 | <template> |
2 | <div class="body-color"> | 2 | <div class="body-color"> |
3 | <!-- LOADER --> | 3 | <!-- LOADER --> |
4 | <div class="loader" v-if="showLoader"> | 4 | <div class="loader" v-if="showLoader"> |
5 | <v-progress-circular indeterminate color="white"></v-progress-circular> | 5 | <v-progress-circular indeterminate color="white"></v-progress-circular> |
6 | </div> | 6 | </div> |
7 | 7 | ||
8 | <!-- SNACKBAR --> | 8 | <!-- SNACKBAR --> |
9 | <v-snackbar | 9 | <v-snackbar |
10 | :timeout="timeout" | 10 | :timeout="timeout" |
11 | :top="y === 'top'" | 11 | :top="y === 'top'" |
12 | :right="x === 'right'" | 12 | :right="x === 'right'" |
13 | :vertical="mode === 'vertical'" | 13 | :vertical="mode === 'vertical'" |
14 | v-model="snackbar" | 14 | v-model="snackbar" |
15 | :color="snackbarColor" | 15 | :color="snackbarColor" |
16 | > | 16 | > |
17 | {{ text }} | 17 | {{ text }} |
18 | <v-spacer></v-spacer> | 18 | <v-spacer></v-spacer> |
19 | <v-btn flat text @click="snackbar = false">X</v-btn> | 19 | <v-btn flat text @click="snackbar = false">X</v-btn> |
20 | </v-snackbar> | 20 | </v-snackbar> |
21 | 21 | ||
22 | <v-container grid-list-xl class="pt-0"> | 22 | <v-container grid-list-xl class="pt-0"> |
23 | <v-layout row wrap class="mt-1"> | 23 | <v-layout row wrap class="mt-1"> |
24 | <!-- if logged in user is parent --> | 24 | <!-- if logged in user is parent --> |
25 | <v-flex xs12 sm12 md9 v-if=" $store.state.role === 'PARENT' "> | 25 | <v-flex xs12 sm12 md9 v-if=" $store.state.role === 'PARENT' "> |
26 | <v-layout column> | 26 | <v-layout column> |
27 | <!-- HEADING --> | 27 | <!-- HEADING --> |
28 | <v-flex> | 28 | <v-flex> |
29 | <div | 29 | <div |
30 | class="title side-bar-color font-weight-bold" | 30 | class="title side-bar-color font-weight-bold" |
31 | >Live Online Classes - {{$route.query.chapterName}}</div> | 31 | >Live Online Classes - {{$route.query.chapterName}}</div> |
32 | <!-- <div class="subheading grey--text lighten-1">{{liveLink}}</div> --> | 32 | <!-- <div class="subheading grey--text lighten-1">{{liveLink}}</div> --> |
33 | <!-- <div | 33 | <!-- <div |
34 | class="subheading grey--text lighten-1" | 34 | class="subheading grey--text lighten-1" |
35 | >The session started at 1:00 there is 1 moderator</div>--> | 35 | >The session started at 1:00 there is 1 moderator</div>--> |
36 | </v-flex> | 36 | </v-flex> |
37 | 37 | ||
38 | <!-- JOIN OR END SESSION --> | 38 | <!-- JOIN OR END SESSION --> |
39 | <v-flex> | 39 | <v-flex v-if="showJoinSessionButton"> |
40 | <div> | 40 | <div> |
41 | <v-btn | 41 | <v-btn |
42 | round | 42 | round |
43 | class="open-dialog-button" | 43 | class="open-dialog-button" |
44 | dark | 44 | dark |
45 | v-if="studentBtn" | 45 | v-if="studentBtn" |
46 | @click="showLoader = true;startChat();" | 46 | @click="showLoader = true;startChat();" |
47 | >{{studentBtn}}</v-btn> | 47 | >{{studentBtn}}</v-btn> |
48 | <span class="subheading grey--twxt lighten-1" v-else>Session hasnt started yet</span> | 48 | <span class="subheading grey--twxt lighten-1" v-else>Session hasnt started yet</span> |
49 | </div> | 49 | </div> |
50 | </v-flex> | 50 | </v-flex> |
51 | <v-flex id="studentClone"> | 51 | <v-flex id="studentClone"> |
52 | <div id="jitsi-container"></div> | 52 | <div id="jitsi-container"></div> |
53 | </v-flex> | 53 | </v-flex> |
54 | </v-layout> | 54 | </v-layout> |
55 | </v-flex> | 55 | </v-flex> |
56 | 56 | ||
57 | <!-- if logged in user is teacher --> | 57 | <!-- if logged in user is teacher --> |
58 | <v-flex xs12 sm12 md12 v-else> | 58 | <v-flex xs12 sm12 md12 v-else> |
59 | <v-layout column> | 59 | <v-layout column> |
60 | <!-- HEADING --> | 60 | <!-- HEADING --> |
61 | <v-flex> | 61 | <v-flex> |
62 | <div | 62 | <div |
63 | class="title side-bar-color font-weight-bold" | 63 | class="title side-bar-color font-weight-bold" |
64 | >Live Online Classes - {{$route.query.chapterName}}</div> | 64 | >Live Online Classes - {{$route.query.chapterName}}</div> |
65 | <!-- <div class="subheading grey--text lighten-1"></div> --> | 65 | <!-- <div class="subheading grey--text lighten-1"></div> --> |
66 | <!-- <div | 66 | <!-- <div |
67 | class="subheading grey--text lighten-1" | 67 | class="subheading grey--text lighten-1" |
68 | >The session started at 1:00 there is 1 moderator</div>--> | 68 | >The session started at 1:00 there is 1 moderator</div>--> |
69 | </v-flex> | 69 | </v-flex> |
70 | 70 | ||
71 | <!-- JOIN OR END SESSION --> | 71 | <!-- JOIN OR END SESSION --> |
72 | <v-flex v-if="showStartSessionButton"> | 72 | <v-flex v-if="showStartSessionButton"> |
73 | <div> | 73 | <div> |
74 | <v-btn | 74 | <v-btn |
75 | round | 75 | round |
76 | class="open-dialog-button" | 76 | class="open-dialog-button" |
77 | dark | 77 | dark |
78 | @click="showLoader = true;startChat()" | 78 | @click="showLoader = true;startChat()" |
79 | >Start Session</v-btn> | 79 | >Start Session</v-btn> |
80 | </div> | 80 | </div> |
81 | </v-flex> | 81 | </v-flex> |
82 | <v-flex id="teacherClone"> | 82 | <v-flex id="teacherClone"> |
83 | <div id="jitsi-container"></div> | 83 | <div id="jitsi-container"></div> |
84 | </v-flex> | 84 | </v-flex> |
85 | </v-layout> | 85 | </v-layout> |
86 | </v-flex> | 86 | </v-flex> |
87 | 87 | ||
88 | <v-spacer></v-spacer> | 88 | <v-spacer></v-spacer> |
89 | 89 | ||
90 | <!-- COURSES SIDE BAR- positioned to the right of the page --> | 90 | <!-- COURSES SIDE BAR- positioned to the right of the page --> |
91 | <!-- <v-flex xs3> | 91 | <!-- <v-flex xs3> |
92 | <v-card class="elevation-0 card-border" height="100%"> | 92 | <v-card class="elevation-0 card-border" height="100%"> |
93 | <CoursesSideBar></CoursesSideBar> | 93 | <CoursesSideBar></CoursesSideBar> |
94 | </v-card> | 94 | </v-card> |
95 | </v-flex>--> | 95 | </v-flex>--> |
96 | </v-layout> | 96 | </v-layout> |
97 | </v-container> | 97 | </v-container> |
98 | </div> | 98 | </div> |
99 | </template> | 99 | </template> |
100 | <script> | 100 | <script> |
101 | import AllApiCalls from "@/Services/AllApiCalls.js"; | 101 | import AllApiCalls from "@/Services/AllApiCalls.js"; |
102 | import http from "@/Services/http.js"; | 102 | import http from "@/Services/http.js"; |
103 | import moment from "moment"; | 103 | import moment from "moment"; |
104 | import Meet from "@/pages/Meet/meet.vue"; | 104 | import Meet from "@/pages/Meet/meet.vue"; |
105 | import CoursesSideBar from "@/pages/Common/CoursesSideBar.vue"; | 105 | import CoursesSideBar from "@/pages/Common/CoursesSideBar.vue"; |
106 | export default { | 106 | export default { |
107 | mixins: [AllApiCalls], | 107 | mixins: [AllApiCalls], |
108 | components: { | 108 | components: { |
109 | CoursesSideBar, | 109 | CoursesSideBar, |
110 | }, | 110 | }, |
111 | data() { | 111 | data() { |
112 | return { | 112 | return { |
113 | startLiveSession: "", | 113 | startLiveSession: "", |
114 | studentBtn: "", | 114 | studentBtn: "", |
115 | 115 | ||
116 | // DATA TABLE | 116 | // DATA TABLE |
117 | search: "", | 117 | search: "", |
118 | pagination: { | 118 | pagination: { |
119 | rowsPerPage: 10, | 119 | rowsPerPage: 10, |
120 | }, | 120 | }, |
121 | liveOnlineHeaders: [ | 121 | liveOnlineHeaders: [ |
122 | { | 122 | { |
123 | text: "Playback", | 123 | text: "Playback", |
124 | value: "attachementUrl", | 124 | value: "attachementUrl", |
125 | sortable: false, | 125 | sortable: false, |
126 | align: "center", | 126 | align: "center", |
127 | }, | 127 | }, |
128 | { | 128 | { |
129 | text: "Meeting", | 129 | text: "Meeting", |
130 | align: "center", | 130 | align: "center", |
131 | sortable: false, | 131 | sortable: false, |
132 | value: "", | 132 | value: "", |
133 | }, | 133 | }, |
134 | { | 134 | { |
135 | text: "Recording", | 135 | text: "Recording", |
136 | value: "", | 136 | value: "", |
137 | sortable: false, | 137 | sortable: false, |
138 | align: "center", | 138 | align: "center", |
139 | }, | 139 | }, |
140 | { | 140 | { |
141 | text: "Description Preview", | 141 | text: "Description Preview", |
142 | value: "", | 142 | value: "", |
143 | sortable: false, | 143 | sortable: false, |
144 | align: "center", | 144 | align: "center", |
145 | }, | 145 | }, |
146 | { text: "Date", value: "", sortable: false, align: "center" }, | 146 | { text: "Date", value: "", sortable: false, align: "center" }, |
147 | { text: "Duration", value: "", sortable: false, align: "center" }, | 147 | { text: "Duration", value: "", sortable: false, align: "center" }, |
148 | { text: "Toolbar", value: "", sortable: false, align: "center" }, | 148 | { text: "Toolbar", value: "", sortable: false, align: "center" }, |
149 | ], | 149 | ], |
150 | liveOnlineItems: [], | 150 | liveOnlineItems: [], |
151 | 151 | ||
152 | // JITSI CONTAINER | 152 | // JITSI CONTAINER |
153 | liveLink: "", | 153 | liveLink: "", |
154 | token: "", | 154 | token: "", |
155 | selectStudents: {}, | 155 | selectStudents: {}, |
156 | classRules: [(v) => !!v || " Class Name is required"], | 156 | classRules: [(v) => !!v || " Class Name is required"], |
157 | sectionRules: [(v) => !!v || " Section Name is required"], | 157 | sectionRules: [(v) => !!v || " Section Name is required"], |
158 | addclass: [], | 158 | addclass: [], |
159 | addSection: [], | 159 | addSection: [], |
160 | loading: false, | 160 | loading: false, |
161 | room: "", | 161 | room: "", |
162 | username: "", | 162 | username: "", |
163 | roomPassword: "", | 163 | roomPassword: "", |
164 | counter: 0, | 164 | counter: 0, |
165 | appLink: "", | 165 | appLink: "", |
166 | showStartSessionButton: true, | 166 | showStartSessionButton: true, |
167 | showJoinSessionButton: true, | ||
167 | }; | 168 | }; |
168 | }, | 169 | }, |
169 | methods: { | 170 | methods: { |
170 | async startChat() { | 171 | async startChat() { |
171 | if (this.$store.state.role === "PARENT") { | 172 | if (this.$store.state.role === "PARENT") { |
172 | if (this.counter == 0) { | 173 | if (this.counter == 0) { |
173 | // console.log("enter start chat"); | 174 | // console.log("enter start chat"); |
174 | const isMobile = /iPhone|iPad|iPod|Android/i.test( | 175 | const isMobile = /iPhone|iPad|iPod|Android/i.test( |
175 | navigator.userAgent | 176 | navigator.userAgent |
176 | ); | 177 | ); |
177 | if (isMobile) { | 178 | if (isMobile) { |
178 | // console.log("==PARENT=appLink==", this.appLink); | 179 | // console.log("==PARENT=appLink==", this.appLink); |
179 | window.open(this.appLink); | 180 | window.open(this.appLink); |
180 | this.showLoader = false; | 181 | this.showLoader = false; |
182 | this.showJoinSessionButton = false; | ||
181 | } else { | 183 | } else { |
182 | this.startConference(); | 184 | this.startConference(); |
183 | this.counter += 1; | 185 | this.counter += 1; |
186 | this.showJoinSessionButton = false; | ||
184 | } | 187 | } |
185 | } | 188 | } |
186 | } | 189 | } |
187 | if (this.$store.state.role === "TEACHER") { | 190 | if (this.$store.state.role === "TEACHER") { |
188 | if (this.counter == 0) { | 191 | if (this.counter == 0) { |
189 | this.createRoom(); | 192 | this.createRoom(); |
190 | this.counter += 1; | 193 | this.counter += 1; |
191 | } | 194 | } |
192 | } | 195 | } |
193 | }, | 196 | }, |
194 | // JITSI CONTAINER | 197 | // JITSI CONTAINER |
195 | startConference() { | 198 | startConference() { |
196 | // console.log("yes session started"); | 199 | // console.log("yes session started"); |
197 | var _this = this; | 200 | var _this = this; |
198 | try { | 201 | try { |
199 | const domain = "meet.intrack.in"; | 202 | const domain = "meet.intrack.in"; |
200 | const options = { | 203 | const options = { |
201 | audioInput: "<deviceLabel>", | 204 | audioInput: "<deviceLabel>", |
202 | audioOutput: "<deviceLabel>", | 205 | audioOutput: "<deviceLabel>", |
203 | videoInput: "<deviceLabel>", | 206 | videoInput: "<deviceLabel>", |
204 | prejoinPageEnabled: false, | 207 | prejoinPageEnabled: false, |
205 | roomName: this.room, | 208 | roomName: this.room, |
206 | height: 500, | 209 | height: 500, |
207 | parentNode: document.getElementById("jitsi-container"), | 210 | parentNode: document.getElementById("jitsi-container"), |
208 | interfaceConfigOverwrite: { | 211 | interfaceConfigOverwrite: { |
209 | filmStripOnly: false, | 212 | filmStripOnly: false, |
210 | SHOW_PROMOTIONAL_CLOSE_PAGE: false, | 213 | SHOW_PROMOTIONAL_CLOSE_PAGE: false, |
211 | SHOW_POWERED_BY: false, | 214 | SHOW_POWERED_BY: false, |
212 | SHOW_JITSI_WATERMARK: false, | 215 | SHOW_JITSI_WATERMARK: false, |
213 | TOOLBAR_BUTTONS: [ | 216 | TOOLBAR_BUTTONS: [ |
214 | "microphone", | 217 | "microphone", |
215 | "camera", | 218 | "camera", |
216 | "closedcaptions", | 219 | "closedcaptions", |
217 | "desktop", | 220 | "desktop", |
218 | "fullscreen", | 221 | "fullscreen", |
219 | "fodeviceselection", | 222 | "fodeviceselection", |
220 | "hangup", | 223 | "hangup", |
221 | "profile", | 224 | "profile", |
222 | "info", | 225 | "info", |
223 | "chat", | 226 | "chat", |
224 | "recording", | 227 | "recording", |
225 | "livestreaming", | 228 | "livestreaming", |
226 | "etherpad", | 229 | "etherpad", |
227 | "sharedvideo", | 230 | "sharedvideo", |
228 | "settings", | 231 | "settings", |
229 | "raisehand", | 232 | "raisehand", |
230 | "videoquality", | 233 | "videoquality", |
231 | "filmstrip", | 234 | "filmstrip", |
232 | "invite", | 235 | "invite", |
233 | "feedback", | 236 | "feedback", |
234 | "stats", | 237 | "stats", |
235 | "shortcuts", | 238 | "shortcuts", |
236 | "tileview", | 239 | "tileview", |
237 | ], | 240 | ], |
238 | }, | 241 | }, |
239 | configOverwrite: { | 242 | configOverwrite: { |
240 | disableSimulcast: false, | 243 | disableSimulcast: false, |
241 | }, | 244 | }, |
242 | teacherName: "", | 245 | teacherName: "", |
243 | room: "", | 246 | room: "", |
244 | }; | 247 | }; |
245 | _this.api = new JitsiMeetExternalAPI(domain, options); | 248 | _this.api = new JitsiMeetExternalAPI(domain, options); |
246 | // console.log("this.api ", this.api); | 249 | // console.log("this.api ", this.api); |
247 | _this.api.addEventListener("videoConferenceJoined", () => { | 250 | _this.api.addEventListener("videoConferenceJoined", () => { |
248 | this.showLoader = false; | 251 | this.showLoader = false; |
249 | setTimeout(() => { | 252 | setTimeout(() => { |
250 | _this.api.executeCommand("displayName", _this.username); | 253 | _this.api.executeCommand("displayName", _this.username); |
251 | _this.api.executeCommand("password", _this.roomPassword); | 254 | _this.api.executeCommand("password", _this.roomPassword); |
252 | }, 1000); | 255 | }, 1000); |
253 | }); | 256 | }); |
254 | 257 | ||
255 | _this.api.on("readyToClose", () => { | 258 | _this.api.on("readyToClose", () => { |
256 | // this.$router.push({ name: "Refresh" }); | 259 | // this.$router.push({ name: "Refresh" }); |
257 | let jitsi = document.getElementById("jitsi-container"); | 260 | let jitsi = document.getElementById("jitsi-container"); |
258 | jitsi.innerHTML = ""; | 261 | jitsi.innerHTML = ""; |
259 | this.showStartSessionButton = true; | 262 | this.showStartSessionButton = true; |
263 | this.showJoinSessionButton = true; | ||
260 | }); | 264 | }); |
261 | } catch (error) { | 265 | } catch (error) { |
262 | // console.error("Failed to load Jitsi API", error); | 266 | // console.error("Failed to load Jitsi API", error); |
263 | } | 267 | } |
264 | }, | 268 | }, |
265 | openRoom() { | 269 | openRoom() { |
266 | // verify the JitsiMeetExternalAPI constructor is added to the global.. | 270 | // verify the JitsiMeetExternalAPI constructor is added to the global.. |
267 | // if (this.teacherName != "" || this.room != "") { | 271 | // if (this.teacherName != "" || this.room != "") { |
268 | // if (window.JitsiMeetExternalAPI) { | 272 | // if (window.JitsiMeetExternalAPI) { |
269 | // // var person = prompt("Please enter your name:", "Rabie"); | 273 | // // var person = prompt("Please enter your name:", "Rabie"); |
270 | // if (person != null || person != "") this.username = this.teacherName; | 274 | // if (person != null || person != "") this.username = this.teacherName; |
271 | // var room = prompt("Please enter your room:", "Test Room"); | 275 | // var room = prompt("Please enter your room:", "Test Room"); |
272 | // if (room != null || room != "") this.room = this.room; | 276 | // if (room != null || room != "") this.room = this.room; |
273 | // this.startConference(); | 277 | // this.startConference(); |
274 | // } else alert("Jitsi Meet API script not loaded"); | 278 | // } else alert("Jitsi Meet API script not loaded"); |
275 | // } | 279 | // } |
276 | }, | 280 | }, |
277 | 281 | ||
278 | createRoom(classId) { | 282 | createRoom(classId) { |
279 | // this.showLoader = true; | 283 | // this.showLoader = true; |
280 | var classId = { | 284 | var classId = { |
281 | classId: classId, | 285 | classId: classId, |
282 | }; | 286 | }; |
283 | http() | 287 | http() |
284 | .post("/createLiveClasses", { | 288 | .post("/createLiveClasses", { |
285 | classId: this.$route.query.classId, | 289 | classId: this.$route.query.classId, |
286 | courseId: this.$route.query.courseId, | 290 | courseId: this.$route.query.courseId, |
287 | chapterId: this.$route.query.chapterId, | 291 | chapterId: this.$route.query.chapterId, |
288 | }) | 292 | }) |
289 | .then((response) => { | 293 | .then((response) => { |
290 | // this.addSection = response.data.data; | 294 | // this.addSection = response.data.data; |
291 | // console.log("CREATE___ROOOM", response.data); | 295 | // console.log("CREATE___ROOOM", response.data); |
292 | var room = response.data.data.roomName; | 296 | var room = response.data.data.roomName; |
293 | var username = localStorage.getItem("teacherName"); | 297 | var username = localStorage.getItem("teacherName"); |
294 | var roomPassword = response.data.data.password; | 298 | var roomPassword = response.data.data.password; |
295 | this.appLink = response.data.data.appLink; | 299 | this.appLink = response.data.data.appLink; |
296 | // console.log( | 300 | // console.log( |
297 | // "room", | 301 | // "room", |
298 | // room, | 302 | // room, |
299 | // "username", | 303 | // "username", |
300 | // username, | 304 | // username, |
301 | // "roomPassword", | 305 | // "roomPassword", |
302 | // roomPassword | 306 | // roomPassword |
303 | // ); | 307 | // ); |
304 | var this_ = this; | 308 | var this_ = this; |
305 | if (username != "" || room != "") { | 309 | if (username != "" || room != "") { |
306 | const isMobile = /iPhone|iPad|iPod|Android/i.test( | 310 | const isMobile = /iPhone|iPad|iPod|Android/i.test( |
307 | navigator.userAgent | 311 | navigator.userAgent |
308 | ); | 312 | ); |
309 | if (isMobile) { | 313 | if (isMobile) { |
310 | // console.log("==TEACHER=appLink==", this.appLink); | 314 | // console.log("==TEACHER=appLink==", this.appLink); |
311 | window.open(this.appLink); | 315 | window.open(this.appLink); |
312 | this.showLoader = false; | 316 | this.showLoader = false; |
313 | this.showStartSessionButton = false; | 317 | this.showStartSessionButton = false; |
314 | } else { | 318 | } else { |
315 | if (window.JitsiMeetExternalAPI) { | 319 | if (window.JitsiMeetExternalAPI) { |
316 | // var person = prompt("Please enter your name:", "Rabie"); | 320 | // var person = prompt("Please enter your name:", "Rabie"); |
317 | if (username != null || username != "") { | 321 | if (username != null || username != "") { |
318 | this_.username = username; | 322 | this_.username = username; |
319 | } | 323 | } |
320 | // var room = prompt("Please enter your room:", "Test Room"); | 324 | // var room = prompt("Please enter your room:", "Test Room"); |
321 | if (room != null || room != "") { | 325 | if (room != null || room != "") { |
322 | this_.room = room; | 326 | this_.room = room; |
323 | } | 327 | } |
324 | if (roomPassword != null || roomPassword != "") { | 328 | if (roomPassword != null || roomPassword != "") { |
325 | this_.roomPassword = roomPassword; | 329 | this_.roomPassword = roomPassword; |
326 | } | 330 | } |
327 | } else alert("Jitsi Meet API script not loaded"); | 331 | } else alert("Jitsi Meet API script not loaded"); |
328 | this_.startConference(); | 332 | this_.startConference(); |
329 | this.showStartSessionButton = false; | 333 | this.showStartSessionButton = false; |
330 | } | 334 | } |
331 | } | 335 | } |
332 | }) | 336 | }) |
333 | .catch((err) => { | 337 | .catch((err) => { |
334 | this.showLoader = false; | 338 | this.showLoader = false; |
335 | }); | 339 | }); |
336 | }, | 340 | }, |
337 | async studentClasses() { | 341 | async studentClasses() { |
338 | this.liveLink = ""; | 342 | this.liveLink = ""; |
339 | this.room = ""; | 343 | this.room = ""; |
340 | this.username = ""; | 344 | this.username = ""; |
341 | this.roomPassword = ""; | 345 | this.roomPassword = ""; |
342 | /* getLiveClassesesList - To up date line under heading*/ | 346 | /* getLiveClassesesList - To up date line under heading*/ |
343 | let response = await this.getLiveClassesesList({ | 347 | let response = await this.getLiveClassesesList({ |
344 | classId: this.$route.query.classId, | 348 | classId: this.$route.query.classId, |
345 | courseId: this.$route.query.courseId, | 349 | courseId: this.$route.query.courseId, |
346 | chapterId: this.$route.query.chapterId, | 350 | chapterId: this.$route.query.chapterId, |
347 | }); | 351 | }); |
348 | // console.log("response getLiveClassesesList- ", response); | 352 | // console.log("response getLiveClassesesList- ", response); |
349 | 353 | ||
350 | /* CHECK RESPONSE TO ASSIGN MESSAGE INSIDE BUTTON */ | 354 | /* CHECK RESPONSE TO ASSIGN MESSAGE INSIDE BUTTON */ |
351 | if (response.data.data[0].sessionStatus == "ENDED") { | 355 | if (response.data.data[0].sessionStatus == "ENDED") { |
352 | // this.startLiveSession = "Start Session"; | 356 | // this.startLiveSession = "Start Session"; |
353 | this.studentBtn = ""; | 357 | this.studentBtn = ""; |
354 | } | 358 | } |
355 | if (response.data.data[0].sessionStatus == "STARTED") { | 359 | if (response.data.data[0].sessionStatus == "STARTED") { |
356 | // this.startLiveSession = "Join Session"; | 360 | // this.startLiveSession = "Join Session"; |
357 | this.studentBtn = "Join Session"; | 361 | this.studentBtn = "Join Session"; |
358 | } | 362 | } |
359 | if (response.data.data.length == 0) { | 363 | if (response.data.data.length == 0) { |
360 | this.startLiveSession = "Start Session"; | 364 | this.startLiveSession = "Start Session"; |
361 | this.studentBtn = ""; | 365 | this.studentBtn = ""; |
362 | } else { | 366 | } else { |
363 | this.liveLink = response.data.data[0].link; | 367 | this.liveLink = response.data.data[0].link; |
364 | this.appLink = response.data.data[0].appLink; | 368 | this.appLink = response.data.data[0].appLink; |
365 | var room = response.data.data[0].roomName; | 369 | var room = response.data.data[0].roomName; |
366 | var username = this.currentUser; | 370 | var username = this.currentUser; |
367 | var roomPassword = response.data.data[0].password; | 371 | var roomPassword = response.data.data[0].password; |
368 | var this_ = this; | 372 | var this_ = this; |
369 | // console.log(this.room, this.roomPassword, this.username); | 373 | // console.log(this.room, this.roomPassword, this.username); |
370 | 374 | ||
371 | if (username != "" || room != "") { | 375 | if (username != "" || room != "") { |
372 | if (window.JitsiMeetExternalAPI) { | 376 | if (window.JitsiMeetExternalAPI) { |
373 | // var person = prompt("Please enter your name:", "Rabie"); | 377 | // var person = prompt("Please enter your name:", "Rabie"); |
374 | if (username != null || username != "") { | 378 | if (username != null || username != "") { |
375 | this_.username = username; | 379 | this_.username = username; |
376 | } | 380 | } |
377 | if (roomPassword != null || roomPassword != "") { | 381 | if (roomPassword != null || roomPassword != "") { |
378 | this_.roomPassword = roomPassword; | 382 | this_.roomPassword = roomPassword; |
379 | } | 383 | } |
380 | // var room = prompt("Please enter your room:", "Test Room"); | 384 | // var room = prompt("Please enter your room:", "Test Room"); |
381 | if (room != null || room != "") { | 385 | if (room != null || room != "") { |
382 | this_.room = room; | 386 | this_.room = room; |
383 | } | 387 | } |
384 | // this.startConference(); | 388 | // this.startConference(); |
385 | } | 389 | } |
386 | } | 390 | } |
387 | } | 391 | } |
388 | }, | 392 | }, |
389 | }, | 393 | }, |
390 | 394 | ||
391 | async created() { | 395 | async created() { |
392 | // console.log( | 396 | // console.log( |
393 | // "this.$store.state.studentsData", | 397 | // "this.$store.state.studentsData", |
394 | // this.$store.state.studentsData[0].name | 398 | // this.$store.state.studentsData[0].name |
395 | // ); | 399 | // ); |
396 | this.currentUser = localStorage.getItem("studentName"); | 400 | this.currentUser = localStorage.getItem("studentName"); |
397 | this.token = this.$store.state.token; | 401 | this.token = this.$store.state.token; |
398 | if (this.$store.state.role === "PARENT") { | 402 | if (this.$store.state.role === "PARENT") { |
399 | await this.studentClasses(); | 403 | await this.studentClasses(); |
400 | } | 404 | } |
401 | 405 | ||
402 | /* getStudentCourses - to get courseData - defined in GetApis.js*/ | 406 | /* getStudentCourses - to get courseData - defined in GetApis.js*/ |
403 | if (this.$store.state.role === "PARENT") { | 407 | if (this.$store.state.role === "PARENT") { |
404 | await this.getStudentCourses({ | 408 | await this.getStudentCourses({ |
405 | classId: localStorage.getItem("parentClassId"), | 409 | classId: localStorage.getItem("parentClassId"), |
406 | studentId: localStorage.getItem("parentStudentId"), | 410 | studentId: localStorage.getItem("parentStudentId"), |
407 | }); | 411 | }); |
408 | } | 412 | } |
409 | }, | 413 | }, |
410 | }; | 414 | }; |
411 | </script> | 415 | </script> |
412 | <style scoped> | 416 | <style scoped> |
413 | .side-bar-color { | 417 | .side-bar-color { |
414 | color: #827bfa !important; | 418 | color: #827bfa !important; |
415 | /* border-top-right-radius: 74px !important; */ | 419 | /* border-top-right-radius: 74px !important; */ |
416 | } | 420 | } |
417 | .card-border { | 421 | .card-border { |
418 | border: 1px #bdbdbd solid; | 422 | border: 1px #bdbdbd solid; |
419 | border-radius: 3px; | 423 | border-radius: 3px; |
420 | } | 424 | } |
421 | .reply-desc { | 425 | .reply-desc { |
422 | border: 1px solid #f2f2f2; | 426 | border: 1px solid #f2f2f2; |
423 | } | 427 | } |
424 | .open-dialog-button { | 428 | .open-dialog-button { |
425 | background: #827bfa !important; | 429 | background: #827bfa !important; |
426 | border-color: #827bfa !important; | 430 | border-color: #827bfa !important; |
427 | text-transform: none !important; | 431 | text-transform: none !important; |
428 | } | 432 | } |
429 | 433 | ||
430 | .reply-btn { | 434 | .reply-btn { |
431 | background: #feb83c !important; | 435 | background: #feb83c !important; |
432 | border-color: #feb83c !important; | 436 | border-color: #feb83c !important; |
433 | text-transform: none !important; | 437 | text-transform: none !important; |
434 | -webkit-box-shadow: none !important; | 438 | -webkit-box-shadow: none !important; |
435 | box-shadow: none !important; | 439 | box-shadow: none !important; |
436 | } | 440 | } |
437 | #jitsi-container { | 441 | #jitsi-container { |
438 | height: 100vh; | 442 | height: 100vh; |
439 | } | 443 | } |
440 | </style> | 444 | </style> |