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