You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
projectx/src/views/RoomView.vue

60 lines
1.7 KiB

4 years ago
<template>
4 years ago
<div fill-height class="fill-height">
<v-dialog
v-model="dialog"
max-width="290"
>
<v-card>
<v-card-title class="headline">
What's your name ?
</v-card-title>
<v-card-text>
<v-text-field label="Name" v-model="name"></v-text-field>
</v-card-text>
<v-card-actions>
<v-btn @click="dialog=false" text>Cancel</v-btn>
<v-spacer></v-spacer>
<v-btn @click="getRoom" color="primary" text>Enter Room</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<VueJanus @kick="kick" v-if="rid" :creator="creator" :room="rid" server="wss://vid.w3ic.org/ws/janus/" :username="name"></VueJanus>
</div>
4 years ago
</template>
<script>
import VueJanus from "@/lib/VueJanus";
export default {
name: "RoomView",
components: {VueJanus},
data: () => ({
4 years ago
rid:'',
name:'',
dialog:false,
creator:false
4 years ago
}),
mounted () {
4 years ago
if (!name) this.dialog = true
4 years ago
},
methods: {
4 years ago
kick (user) {
this.$axios.get(`kick/${this.$route.params.id}/${user}`).then(response => {
console.log(response)
})
},
4 years ago
getRoom () {
4 years ago
this.dialog = false
4 years ago
this.$axios.get(`room/${this.$route.params.id}`).then(response => {
this.rid = response.data.rid
4 years ago
this.creator = response.data.can_modify
4 years ago
})
}
}
}
</script>
<style scoped>
</style>