Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Meet/Room.vue
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | |||||
</template> | </template> | ||||
<script> | <script> | ||||
import Meet from '../../js/meet/app.js' | import Meet from '../../js/meet/app.js' | ||||
import StatusMessage from '../Widgets/StatusMessage' | import StatusMessage from '../Widgets/StatusMessage' | ||||
import LogonForm from '../Login' | import LogonForm from '../Login' | ||||
import SessionSecurityOptions from './SessionSecurityOptions' | import SessionSecurityOptions from './SessionSecurityOptions' | ||||
// Register additional icons | |||||
import { library } from '@fortawesome/fontawesome-svg-core' | |||||
import { | |||||
faAlignLeft, | |||||
faCompress, | |||||
faDesktop, | |||||
faExpand, | |||||
faMicrophone, | |||||
faPowerOff, | |||||
faUser, | |||||
faShieldAlt, | |||||
faVideo, | |||||
faVolumeMute | |||||
} from '@fortawesome/free-solid-svg-icons' | |||||
// Register only these icons we need | |||||
library.add( | |||||
faAlignLeft, | |||||
faCompress, | |||||
faDesktop, | |||||
faExpand, | |||||
faMicrophone, | |||||
faPowerOff, | |||||
faUser, | |||||
faShieldAlt, | |||||
faVideo, | |||||
faVolumeMute | |||||
) | |||||
let roomRequest | let roomRequest | ||||
export default { | export default { | ||||
components: { | components: { | ||||
LogonForm, | LogonForm, | ||||
SessionSecurityOptions, | SessionSecurityOptions, | ||||
StatusMessage | StatusMessage | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 227 Lines • ▼ Show 20 Lines | export default { | ||||
this.session.onDestroy = event => { | this.session.onDestroy = event => { | ||||
// TODO: Display different message for each reason: forceDisconnectByUser, | // TODO: Display different message for each reason: forceDisconnectByUser, | ||||
// forceDisconnectByServer, sessionClosedByServer? | // forceDisconnectByServer, sessionClosedByServer? | ||||
if (event.reason != 'disconnect' && event.reason != 'networkDisconnect' && !this.session.owner) { | if (event.reason != 'disconnect' && event.reason != 'networkDisconnect' && !this.session.owner) { | ||||
$('#leave-dialog').on('hide.bs.modal', () => { | $('#leave-dialog').on('hide.bs.modal', () => { | ||||
// FIXME: Where exactly the user should land? Currently he'll land | // FIXME: Where exactly the user should land? Currently he'll land | ||||
// on dashboard (if he's logged in) or login form (if he's not). | // on dashboard (if he's logged in) or login form (if he's not). | ||||
window.location = window.config['app.url'] | this.$router.push({ name: 'dashboard' }) | ||||
}).modal() | }).modal() | ||||
} | } | ||||
} | } | ||||
this.session.onDismiss = connId => { this.dismissParticipant(connId) } | this.session.onDismiss = connId => { this.dismissParticipant(connId) } | ||||
if (this.session.owner) { | if (this.session.owner) { | ||||
this.session.onJoinRequest = data => { this.joinRequest(data) } | this.session.onJoinRequest = data => { this.joinRequest(data) } | ||||
} | } | ||||
this.meet.joinRoom(this.session) | this.meet.joinRoom(this.session) | ||||
}, | }, | ||||
logout() { | logout() { | ||||
const logout = () => { | const logout = () => { | ||||
this.meet.leaveRoom() | this.meet.leaveRoom() | ||||
this.meet = null | this.meet = null | ||||
window.location = window.config['app.url'] | this.$router.push({ name: 'dashboard' }) | ||||
} | } | ||||
if (this.session.owner) { | if (this.session.owner) { | ||||
axios.post('/api/v4/openvidu/rooms/' + this.room + '/close').then(logout) | axios.post('/api/v4/openvidu/rooms/' + this.room + '/close').then(logout) | ||||
} else { | } else { | ||||
logout() | logout() | ||||
} | } | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |