some fixing and tooltip support #20

Merged
xcoder merged 2 commits from gencoglutugrul/projectx:master into master 5 years ago
  1. 106
      src/lib/VueJanus.vue

@ -107,6 +107,7 @@
direction="top" direction="top"
open-on-hover open-on-hover
> >
<template v-slot:activator> <template v-slot:activator>
<v-btn <v-btn
v-model="fab" v-model="fab"
@ -118,38 +119,71 @@
<v-icon v-else>mdi-cog-outline</v-icon> <v-icon v-else>mdi-cog-outline</v-icon>
</v-btn> </v-btn>
</template> </template>
<v-btn
fab <v-tooltip right>
dark <template v-slot:activator="{ on }">
small <v-btn
@click="sharePdf=true" v-on="on"
> fab
<v-icon>mdi-pdf-box</v-icon> dark
</v-btn> <v-btn small
fab @click="sharePdf=true"
dark >
small <v-icon>mdi-pdf-box</v-icon>
@click="$vuetify.theme.dark=!$vuetify.theme.dark" </v-btn>
> </template>
<v-icon>mdi-compare</v-icon>
</v-btn> <span>Toggle Share PDF</span>
<v-btn </v-tooltip>
fab
dark <v-tooltip right>
small <template v-slot:activator="{ on }">
<v-btn
@click="deviceSelectDialog = true" v-on="on"
> fab
<v-icon>mdi-camera-outline</v-icon> dark
</v-btn> small
<v-btn @click="$vuetify.theme.dark=!$vuetify.theme.dark"
fab >
:dark="!screenShareStarted" <v-icon>mdi-compare</v-icon>
small </v-btn>
@click="screenShareSwitch" </template>
>
<v-icon>mdi-monitor-screenshot</v-icon> <span>Toggle Theme</span>
</v-btn> </v-tooltip>
<v-tooltip right>
<template v-slot:activator="{ on }">
<v-btn
v-on="on"
fab
dark
small
@click="deviceSelectDialog = true"
>
<v-icon>mdi-camera-outline</v-icon>
</v-btn>
</template>
<span>Toggle Camera</span>
</v-tooltip>
<v-tooltip right>
<template v-slot:activator="{ on }">
<v-btn
v-on="on"
fab
:dark="!screenShareStarted"
small
@click="screenShareSwitch"
>
<v-icon>mdi-monitor-screenshot</v-icon>
</v-btn>
</template>
<span>Toggle Share Screen</span>
</v-tooltip>
</v-speed-dial> </v-speed-dial>
</v-container> </v-container>
</template> </template>
@ -246,7 +280,7 @@
}, },
onlocalstreamScreen (stream) { onlocalstreamScreen (stream) {
if(this.screenShareStarted) if(this.screenShareStarted)
this.screenShareStarted=false; this.screenShareStarted=true;
this.$refs.ownstreamscreen.srcObject = stream this.$refs.ownstreamscreen.srcObject = stream
}, },
@ -272,7 +306,9 @@
onlocalstream: this.onlocalstreamScreen onlocalstream: this.onlocalstreamScreen
} }
) )
this.screenShareStarted=true;
this.mozillaAlert=false;
this.chromeAlert=false;
}, },
screenShareStop(){ screenShareStop(){
var srcObject=this.$refs.ownstreamscreen.srcObject; var srcObject=this.$refs.ownstreamscreen.srcObject;
@ -282,6 +318,8 @@
var unpublish = { request: 'unpublish' }; var unpublish = { request: 'unpublish' };
this.janusScreenShareHandle.send({ message: unpublish }); this.janusScreenShareHandle.send({ message: unpublish });
this.janusScreenShareHandle.detach(); this.janusScreenShareHandle.detach();
this.screenShareStarted=false;
}, },
screenShare () { screenShare () {
if(!this.$janus.isExtensionEnabled()) { if(!this.$janus.isExtensionEnabled()) {

Loading…
Cancel
Save