stop screen share button added

pull/2/head
Tuğrul Gençoğlu 5 years ago
parent c09e15ad51
commit 73a99abacd
  1. 3
      src/App.vue
  2. 14
      src/lib/VueJanus.vue

@ -1,7 +1,8 @@
<template>
<v-app>
<v-content>
<v-text-field v-if="!start" v-model="username" label="please enter name"></v-text-field> <v-btn v-if="!start" @click="startM">Start</v-btn>
<v-text-field v-if="!start" v-model="username" label="please enter name"></v-text-field>
<v-btn v-if="!start" @click="startM">Start</v-btn>
<VueJanus v-if="start" server="https://vid.w3ic.org/janus" :room="room" :username="username"/>
</v-content>
</v-app>

@ -2,7 +2,7 @@
<v-container>
<v-btn @click="deviceSelectDialog = true">change</v-btn>
<v-btn @click="screenShare">share a screen</v-btn>
<v-btn @click="screenShareStop" v-if="screenShareStarted">stop screen share</v-btn>
<v-dialog
v-model="mozillaAlert"
@ -129,7 +129,8 @@
deviceSelectDialog: false,
noVid: false,
shareScreenId: null,
remoteStreams: []
remoteStreams: [],
screenShareStarted: false
}
},
name: "VueJanus",
@ -196,7 +197,14 @@
onlocalstream: this.onlocalstreamScreen
}
)
this.screenShareStarted=true;
},
screenShareStop(){
let srcObject=this.$refs.ownstreamscreen.srcObject;
for (const track of srcObject.getTracks()) {
track.stop();
}
this.screenShareStarted=false;
},
screenShare () {
if(!this.$janus.isExtensionEnabled()) {

Loading…
Cancel
Save