added audio room connection/deco management

This commit is contained in:
xdrm-brackets 2018-04-24 11:08:06 +02:00
parent b25d0b6249
commit 5166847f77
2 changed files with 6 additions and 6 deletions

View File

@ -46,20 +46,20 @@ export default class RoomController{
if( type === 'text' ) if( type === 'text' )
this[type].current = room.id; this[type].current = room.id;
/* (5) Tell websocket: new text room */ /* (5) If 'voice' room -> toggle audio */
if( typeof this[type].current === 'number' && window.csock instanceof wscd )
(type === 'text') && csock.send({ buffer: { rid: room.id } });
/* (6) If 'voice' room -> toggle audio */
if( type === 'voice' ){ if( type === 'voice' ){
AudioManager.kill(); AudioManager.kill();
csock.send({ buffer: { audio: false } });
if( typeof this[type].current === 'number' ) if( typeof this[type].current === 'number' )
AudioManager.launch(this[type].current); AudioManager.launch(this[type].current);
} }
/* (6) Tell websocket we connect to room */
if( typeof this[type].current === 'number' && window.csock instanceof wscd )
csock.send({ buffer: { rid: this[type].current } });
/* (6) Update buffer */ /* (6) Update buffer */
this._buffer[type] = {}; this._buffer[type] = {};

View File

@ -38,7 +38,7 @@
<div v-if='r.type===`voice`' v-show='r.members.length>0' class='member-list'> <div v-if='r.type===`voice`' v-show='r.members.length>0' class='member-list'>
<span v-for='uid in r.members'> <span v-for='uid in r.members'>
<div class='icon' :style='`background-image: url("https://picsum.photos/150/?random&nonce=${uid}");`'></div> <div class='icon' :style='`background-image: url("https://picsum.photos/150/?random&nonce=${uid}");`'></div>
<span>{{ gs.content.user(uid).username }}</span> <span>{{ ( uid == gs.auth.user.uid ) ? 'You' : gs.content.user(uid).username }} </span>
</span> </span>
</div> </div>
</li> </li>