Now displays when user is actually talking

This commit is contained in:
perroned 2014-07-24 09:12:27 -07:00
parent 0b931aa7d8
commit f826215dd7
4 changed files with 22 additions and 25 deletions

View File

@ -80,20 +80,6 @@ Meteor.methods
Handlebars.registerHelper "getMeetingName", ->
window.getMeetingName()
Handlebars.registerHelper "isCurrentUserTalking", ->
u = Meteor.Users.findOne({'userId': getInSession("userId")})
if u?
console.log u
u.user?.voiceUser?.talking
false
Handlebars.registerHelper "isCurrentUserSharingAudio", ->
getInSession "isSharingAudio"
Handlebars.registerHelper "isUserSharingAudio", (u) ->
if u?
u.user?.voiceUser?.talking?
Handlebars.registerHelper "isUserSharingVideo", (u) ->
u.webcam_stream.length isnt 0
@ -106,3 +92,14 @@ Handlebars.registerHelper "getUsersInMeeting", ->
@getTime = -> # returns epoch in ms
(new Date).valueOf()
Handlebars.registerHelper "isUserTalking", (u) ->
console.log "inside isUserTalking"
console.log u
if u?
u.voiceUser?.talking
else
return false
Handlebars.registerHelper "isUserSharingAudio", ->
getInSession "isSharingAudio"

View File

@ -41,6 +41,12 @@
{{> makeButton id=user.externUserId btn_class="audioFeedIcon navbar-brand" i_class="volume-off" sharingAudio=false _id=_id}}
{{/if}}
{{#if isUserTalking user}}
<span>TALKING</span>
{{else}}
<span>NO TALKING</span>
{{/if}}
{{> makeButton id="" btn_class="hideNavbarIcon pull-right navbar-brand" i_class="chevron-up"}}
{{> makeButton id="user.externUserId" btn_class="signOutIcon pull-right navbar-brand" i_class="log-out"}}
{{> makeButton id="user.externUserId" btn_class="settingsIcon pull-right navbar-brand" i_class="cog"}}

View File

@ -28,8 +28,8 @@
<td>
{{#if user.handRaised}}
{{> makeButton id=user.externUserId btn_class="raiseHand btn-primary" i_class="hand-up" _id=_id isDisabled="disabled"}}
{{else}}
{{> makeButton id=user.externUserId btn_class="raiseHand btn-primary" i_class="hand-up" _id=_id}}
<!-- {{else}}
{{> makeButton id=user.externUserId btn_class="raiseHand btn-primary" i_class="hand-up" _id=_id}} -->
{{/if}}
</td>
</template>

View File

@ -98,15 +98,9 @@ class Meteor.RedisPubSub
if message.header?.name is 'user_voice_talking_message'
u = Meteor.Users.findOne({'userId': message.payload?.user?.userid})
if u?
console.log "setting talking to true\n\n\n\n"
Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.talking':true}})
else
u = Meteor.Users.findOne({'userId': message.payload?.user?.userid})
if u?
console.log 'setting talking to false\n\n\n\n--------------------------------------------------------------------'
console.log jsonMsg
console.log '--------------------------------------------------------------------'
Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.talking':false}})
console.log "setting talking to #{message?.payload?.user?.voiceUser?.talking}\n\n\n\n"
Meteor.Users.update({_id:u._id}, {$set: {'user.voiceUser.talking':message?.payload?.user?.voiceUser?.talking}})
if message.header?.name is "get_all_meetings_reply"
console.log "Let's store some data for the running meetings so that when an HTML5 client joins everything is ready!"