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

82 lines
2.5 KiB

4 years ago
<template>
4 years ago
<div fill-height class="fill-height">
3 years ago
<ObsVue server="ws://localhost:4444/"></ObsVue>
<v-dialog
4 years ago
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>
3 years ago
<VueJanus @kick="kick" @rtp="rtp" :streamer="hasStreamer" v-if="rid" :creator="creator" :room="1234" server="ws://localhost:8188/ws" :username="name"></VueJanus>
4 years ago
</div>
4 years ago
</template>
<script>
import VueJanus from "@/lib/VueJanus";
3 years ago
// import ObsVue from "@/lib/ObsVue";
4 years ago
export default {
name: "RoomView",
components: {VueJanus},
3 years ago
// components: {ObsVue},
4 years ago
data: () => ({
4 years ago
rid:'',
name:'',
3 years ago
hasStreamer: false,
4 years ago
dialog:false,
creator:false
4 years ago
}),
3 years ago
created () {
console.log(this.$route.params)
this.name = this.$route.params.name
this.streamer = this.$route.params.streamer
this.hasStreamer = !!this.$route.params.streamer
},
4 years ago
mounted () {
3 years ago
console.log(this.$route.params)
this.name = this.$route.params.name
this.streamer = this.$route.params.streamer
this.hasStreamer = !!this.$route.params.streamer
if (this.name) this.getRoom()
if (!this.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)
})
},
3 years ago
rtp (user) {
this.$axios.get(`rtp/${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 => {
3 years ago
this.rid = 1234
4 years ago
this.creator = response.data.can_modify
4 years ago
})
}
}
}
</script>
<style scoped>
</style>