- Notifications
You must be signed in to change notification settings - Fork3
zeye-video/vue-zeye-client
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Pronouced like [zaɪ]Client
Designed to work in pair with myfork ofmediasoup-demo-server
VueZeyeClient relies heavily on vuex.Everything under the hood work is in there, so installing vuex is mandatory.
<scriptsrc="https://unpkg.com/vue/dist/vue.js"></script><scriptsrc="https://unpkg.com/vue/dist/vuex.js"></script><scriptsrc="https://unpkg.com/vue-zeye-client/dist/vue-zeye-client.js"></script><divid="#app"><!-- NOTE: here the outputs --></div>
npm install stasoft91/vue-zeye-client
yarn add stasoft91/vue-zeye-client
// If using a module system (e.g. via Vue CLI), import Vue and vue-zeye-client and then call Vue.use(vue-zeye-client).// import Vue from 'vue'// import Vuex from 'vuex'// import vueZeyeClient from 'vue-zeye-client'Vue.use(Vuex)conststore=newVuex.Store({modules:{/* this line us mandatory, because all zeyeClient vuex modules are designed to be nested under 'zeyeClient' to prevent any conflicts with existing store */zeyeClient:{namespaced:true}}})Vue.use(zeyeClient,store)// Now the app has started!newVue({}).$mount('#app')
Then somewhere in yourconference.vue
:
<divstyle="width:250px"><zeye-peer-media:show-volume-bar="true":peer-id="'me'"></zeye-peer-media></div><divstyle="width:250px"v-for="peer in $zeyeClient.getPeers()":key="peer.id"><zeye-peer-media:show-volume-bar="true":peer-id="peer.id"></zeye-peer-media></div>
And in script section:
exportdefault{mounted(){this.$zeyeClient.setRoomUrl()constroomId='example01'constpeerId='example'+Math.random()this.$zeyeClient.setMe(peerId)this.$zeyeClient.join({ roomId, peerId,displayName:this.$zeyeClient.getMe().displayName})}}
- Create empty zeyeClient.js in store
- Create plugins/vue-zye-client.js with code below then mention it in plugins section in nuxt.config.js
// plugins/vue-zeye-client.jsimport zeyeClient from 'vue-zeye-client'import Vue from 'vue'export default ({ store }) => { Vue.use(zeyeClient, store)}
SeeDocs