Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Meet/Room.vue
Show First 20 Lines • Show All 578 Lines • ▼ Show 20 Lines | export default { | ||||
// draw the image on the canvas (square cropped and resized) | // draw the image on the canvas (square cropped and resized) | ||||
canvas.getContext('2d').drawImage(video, sx, sy, sw, sh, 0, 0, dw, dh); | canvas.getContext('2d').drawImage(video, sx, sy, sw, sh, 0, 0, dw, dh); | ||||
// convert it to a usable data URL (png format) | // convert it to a usable data URL (png format) | ||||
return canvas.toDataURL(); | return canvas.toDataURL(); | ||||
}, | }, | ||||
requestId() { | requestId() { | ||||
const key = 'kolab-meet-uid' | |||||
if (!this.reqId) { | |||||
this.reqId = localStorage.getItem(key) | |||||
} | |||||
if (!this.reqId) { | if (!this.reqId) { | ||||
// FIXME: Shall we use some UUID generator? Or better something that identifies the | // We store the identifier in the browser to make sure that it is the same after | ||||
// user/browser so we could deny the join request for a longer time. | // page refresh for the avg user. This will not prevent hackers from sending | ||||
// I'm thinking about e.g. a bad actor knocking again and again and again, | // the new identifier on every request. | ||||
// we don't want the room owner to be bothered every few seconds. | // If we're afraid of a room owner being spammed with join requests we might invent | ||||
// Maybe a solution would be to store the identifier in the browser storage | // a way to silently ignore all join requests after the owner pressed some button | ||||
// This would not prevent hackers from sending the new identifier on every request, | // stating "all attendees already joined, lock the room for good!". | ||||
// but could make sure that it is kept after page refresh for the avg user. | |||||
// This will create max. 24-char numeric string | // This will create max. 24-char numeric string | ||||
this.reqId = (String(Date.now()) + String(Math.random()).substring(2)).substring(0, 24) | this.reqId = (String(Date.now()) + String(Math.random()).substring(2)).substring(0, 24) | ||||
localStorage.setItem(key, this.reqId) | |||||
} | } | ||||
return this.reqId | return this.reqId | ||||
}, | }, | ||||
roomOptions() { | roomOptions() { | ||||
$('#room-options-dialog').modal() | $('#room-options-dialog').modal() | ||||
}, | }, | ||||
setMenuItem(type, state, disabled) { | setMenuItem(type, state, disabled) { | ||||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |