Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Meet/Room.vue
Show First 20 Lines • Show All 619 Lines • ▼ Show 20 Lines | export default { | ||||
const enabled = this.meet.switchAudio() | const enabled = this.meet.switchAudio() | ||||
this.setMenuItem('audio', enabled) | this.setMenuItem('audio', enabled) | ||||
}, | }, | ||||
switchVideo() { | switchVideo() { | ||||
const enabled = this.meet.switchVideo() | const enabled = this.meet.switchVideo() | ||||
this.setMenuItem('video', enabled) | this.setMenuItem('video', enabled) | ||||
}, | }, | ||||
switchScreen() { | switchScreen() { | ||||
this.meet.switchScreen(enabled => { | const switchScreenAction = () => { | ||||
this.meet.switchScreen((enabled, error) => { | |||||
this.setMenuItem('screen', enabled) | this.setMenuItem('screen', enabled) | ||||
if (!enabled && !error) { | |||||
// Closing a screen sharing connection invalidates the token | |||||
delete this.session.shareToken | |||||
} | |||||
}) | |||||
} | |||||
// After one screen sharing session ended request a new token | if (this.session.shareToken || !$('#meet-session-menu').find('.link-screen').is('.text-danger')) { | ||||
// for the next screen sharing session | switchScreenAction() | ||||
if (!enabled) { | } else { | ||||
// TODO: This might need to be a different route. E.g. the room password might have | axios.post('/api/v4/openvidu/rooms/' + this.room + '/connections') | ||||
// changed since user joined the session | |||||
// Also because it creates a redundant connection (token) | |||||
axios.post('/api/v4/openvidu/rooms/' + this.room, this.post, { ignoreErrors: true }) | |||||
.then(response => { | .then(response => { | ||||
// Response data contains: session, token and shareToken | this.session.shareToken = response.data.token | ||||
this.session.shareToken = response.data.shareToken | |||||
this.meet.updateSession(this.session) | this.meet.updateSession(this.session) | ||||
switchScreenAction() | |||||
}) | }) | ||||
} | } | ||||
}) | |||||
}, | }, | ||||
updateParticipant(connId, params) { | updateParticipant(connId, params) { | ||||
if (this.isModerator()) { | if (this.isModerator()) { | ||||
axios.put('/api/v4/openvidu/rooms/' + this.room + '/connections/' + connId, params) | axios.put('/api/v4/openvidu/rooms/' + this.room + '/connections/' + connId, params) | ||||
} | } | ||||
}, | }, | ||||
updateSession(data) { | updateSession(data) { | ||||
let params = {} | let params = {} | ||||
Show All 24 Lines |