@ -2,6 +2,39 @@
< q -card
class = "csc-conf-participant-cont"
>
< div class = "csc-conf-audio-icons-cont" >
< q -icon
name = "more_vert"
class = "csc-conf-toggle-audio-menu-icon"
>
< q -popover ref = "popover" class = "csc-conf-toggle-audio-popover" >
< q -list
link
class = "no-border csc-conf-toggle-audio-menu-item"
>
< q -item
@ click = "toggleAudio"
>
< q -item -main
: label = "audioLabel()"
/ >
< / q - i t e m >
< / q - l i s t >
< / q - p o p o v e r >
< / q - i c o n >
< q -icon
class = "csc-conf-toggle-audio-icon"
name = "volume_off"
v - if = "isMuted"
>
< / q - i c o n >
< q -icon
class = "csc-conf-toggle-audio-icon"
name = "volume_up"
v - if = "!isMuted"
>
< / q - i c o n >
< / div >
< q -icon
name = "person"
class = "csc-conf-avatar"
@ -24,7 +57,7 @@
< / template >
< script >
import { QIcon , QCard , QCardMedia , QCardTitle } from 'quasar-framework'
import { QIcon , QCard , QCardMedia , QCardTitle , QPopover , QList , QItem , QItemMain } from 'quasar-framework'
import CscMedia from "../../CscMedia" ;
import {
mapGetters ,
@ -37,11 +70,16 @@
QCard ,
QCardMedia ,
QCardTitle ,
QPopover ,
QList ,
QItem ,
QItemMain ,
CscMedia
} ,
data : function ( ) {
return {
localMediaStream : null
localMediaStream : null ,
isMuted : false
}
} ,
props : [
@ -59,29 +97,38 @@
] )
} ,
mounted ( ) {
this . assignStream ( this ) ;
this . assignStream ( ) ;
if ( ! this . manualSelection ) {
this . $store . commit ( 'conference/setSelectedParticipant' , this . remoteParticipant . id ) ;
}
} ,
methods : {
assignStream : ( scope ) => {
if ( scope . $refs . cscMedia && scope . remoteMediaStreams [ scope . remoteParticipant . id ] === scope . remoteParticipant . id ) {
scope . localMediaStream = scope . remoteMediaStream ( scope . remoteParticipant . id ) ;
scope . $refs . cscMedia . assignStream ( scope . localMediaStream ) ;
if ( scope . selectedParticipant == scope . remoteParticipant . id ) {
scope . $store . commit ( 'conference/setSelectedParticipant' , 'local' ) ; / / T O D O i m p r o v e ( w o r k a r o u n d t o r e s e t t h e m e d i a S t r e a m )
scope . $store . commit ( 'conference/setSelectedParticipant' , scope . remoteParticipant . id ) ;
assignStream ( ) {
if ( this . $refs . cscMedia && this . remoteMediaStreams [ this . remoteParticipant . id ] === this . remoteParticipant . id ) {
this . localMediaStream = this . remoteMediaStream ( this . remoteParticipant . id ) ;
this . $refs . cscMedia . assignStream ( this . localMediaStream ) ;
if ( this . selectedParticipant == this . remoteParticipant . id ) {
this . $store . commit ( 'conference/setSelectedParticipant' , 'local' ) ; / / T O D O i m p r o v e ( w o r k a r o u n d t o r e s e t t h e m e d i a S t r e a m )
this . $store . commit ( 'conference/setSelectedParticipant' , this . remoteParticipant . id ) ;
}
}
else if ( scope . $refs . cscMedia ) {
scope . $refs . cscMedia . reset ( ) ;
else if ( this . $refs . cscMedia ) {
this . $refs . cscMedia . reset ( ) ;
}
} ,
toggleAudio ( ) {
this . $refs . popover . close ( )
this . isMuted = this . $refs . cscMedia . toggleAudio ( ) ;
} ,
audioLabel ( ) {
return this . isMuted
? this . $t ( 'conferencing.unmuteMicrophone' )
: this . $t ( 'conferencing.muteMicrophone' ) ;
}
} ,
watch : {
remoteMediaStreams ( ) {
this . assignStream ( this ) ;
this . assignStream ( ) ;
}
}
}
@ -89,4 +136,20 @@
< style lang = "stylus" rel = "stylesheet/stylus" >
@ import '../../../themes/app.common.styl'
. csc - conf - audio - icons - cont
position relative
width 100 %
. csc - conf - toggle - audio - menu - icon
position absolute
padding - top 5 px
z - index 10
. csc - conf - toggle - audio - icon
@ extend . csc - conf - toggle - audio - menu - icon
right 5 px
cursor default
. csc - conf - toggle - audio - popover
width 115 px
. csc - conf - toggle - audio - menu - item
. q - item
font - size 14 px
< / style >