Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Meet/Room.vue
<template> | <template> | ||||
<div id="meet-component"> | <div id="meet-component"> | ||||
<div id="meet-session-toolbar" class="hidden"> | <div id="meet-session-toolbar" class="hidden"> | ||||
<div id="meet-session-menu"> | <div id="meet-session-menu"> | ||||
<button class="btn btn-link link-audio" @click="switchSound" title="Mute audio"> | <button class="btn btn-link link-audio" @click="switchSound" :disabled="!isPublisher()" title="Mute audio"> | ||||
<svg-icon icon="microphone"></svg-icon> | <svg-icon icon="microphone"></svg-icon> | ||||
</button> | </button> | ||||
<button class="btn btn-link link-video" @click="switchVideo" title="Mute video"> | <button class="btn btn-link link-video" @click="switchVideo" :disabled="!isPublisher()" title="Mute video"> | ||||
<svg-icon icon="video"></svg-icon> | <svg-icon icon="video"></svg-icon> | ||||
</button> | </button> | ||||
<button class="btn btn-link link-screen text-danger" @click="switchScreen" :disabled="!canShareScreen" title="Share screen"> | <button class="btn btn-link link-screen text-danger" @click="switchScreen" :disabled="!canShareScreen || !isPublisher()" title="Share screen"> | ||||
<svg-icon icon="desktop"></svg-icon> | <svg-icon icon="desktop"></svg-icon> | ||||
</button> | </button> | ||||
<button class="btn btn-link link-chat text-danger" @click="switchChat" title="Chat"> | <button class="btn btn-link link-chat text-danger" @click="switchChat" title="Chat"> | ||||
<svg-icon icon="align-left"></svg-icon> | <svg-icon icon="align-left"></svg-icon> | ||||
</button> | </button> | ||||
<button class="btn btn-link link-fullscreen closed hidden" @click="switchFullscreen" title="Full screen"> | <button class="btn btn-link link-fullscreen closed hidden" @click="switchFullscreen" title="Full screen"> | ||||
<svg-icon icon="expand"></svg-icon> | <svg-icon icon="expand"></svg-icon> | ||||
</button> | </button> | ||||
▲ Show 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | export default { | ||||
}, | }, | ||||
initSession(init) { | initSession(init) { | ||||
this.post = { | this.post = { | ||||
password: this.password, | password: this.password, | ||||
nickname: this.nickname, | nickname: this.nickname, | ||||
screenShare: this.canShareScreen ? 1 : 0, | screenShare: this.canShareScreen ? 1 : 0, | ||||
init: init ? 1 : 0, | init: init ? 1 : 0, | ||||
picture: init ? this.makePicture() : '', | picture: init ? this.makePicture() : '', | ||||
requestId: this.requestId() | requestId: this.requestId(), | ||||
role: this.camera || this.microphone ? 'PUBLISHER' : 'SUBSCRIBER' | |||||
} | } | ||||
$('#setup-password,#setup-nickname').removeClass('is-invalid') | $('#setup-password,#setup-nickname').removeClass('is-invalid') | ||||
axios.post('/api/v4/openvidu/rooms/' + this.room, this.post, { ignoreErrors: true }) | axios.post('/api/v4/openvidu/rooms/' + this.room, this.post, { ignoreErrors: true }) | ||||
.then(response => { | .then(response => { | ||||
// Response data contains: session, token and shareToken | // Response data contains: session, token and shareToken | ||||
this.roomState = 'ready' | this.roomState = 'ready' | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | export default { | ||||
break; | break; | ||||
} | } | ||||
}) | }) | ||||
if (document.fullscreenEnabled) { | if (document.fullscreenEnabled) { | ||||
$('#meet-session-menu').find('.link-fullscreen.closed').removeClass('hidden') | $('#meet-session-menu').find('.link-fullscreen.closed').removeClass('hidden') | ||||
} | } | ||||
}, | }, | ||||
isPublisher() { | |||||
return this.session && this.session.role && this.session.role != 'SUBSCRIBER' | |||||
}, | |||||
isRoomReady() { | isRoomReady() { | ||||
return ['ready', 324, 325, 326, 327].includes(this.roomState) | return ['ready', 322, 324, 325, 326, 327].includes(this.roomState) | ||||
}, | }, | ||||
// An event received by the room owner when a participant is asking for a permission to join the room | // An event received by the room owner when a participant is asking for a permission to join the room | ||||
joinRequest(data) { | joinRequest(data) { | ||||
// The toast for this user request already exists, ignore | // The toast for this user request already exists, ignore | ||||
// It's not really needed as we do this on server-side already | // It's not really needed as we do this on server-side already | ||||
if ($('#i' + data.requestId).length) { | if ($('#i' + data.requestId).length) { | ||||
return | return | ||||
} | } | ||||
▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines |