From 63a3a4c737000f358bee3ed1cb6869a6750416e5 Mon Sep 17 00:00:00 2001 From: perroned Date: Mon, 23 Jun 2014 09:58:30 -0700 Subject: [PATCH] Created a helper and rewrote logic to determine if user is sharing audio/video --- labs/meteor-client/client/globals.coffee | 10 ++++++++-- labs/meteor-client/client/main.html | 4 ++-- labs/meteor-client/client/views/users/user_item.html | 12 ++++++------ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/labs/meteor-client/client/globals.coffee b/labs/meteor-client/client/globals.coffee index c4b0ce190b..1ca7b4e2f9 100755 --- a/labs/meteor-client/client/globals.coffee +++ b/labs/meteor-client/client/globals.coffee @@ -10,7 +10,7 @@ Handlebars.registerHelper "getInSession", (k) -> Session.get k @getCurrentUserFromSession = -> id = Session.get("userId") u = Meteor.Users.findOne("userId": id) - console.log Meteor.Users + #console.log Meteor.Users u # retrieve account for selected user @@ -38,4 +38,10 @@ Meteor.methods sendMeetingInfoToClient: (meetingId, userId) -> Session.set("userId", userId) Session.set("meetingId", meetingId) - \ No newline at end of file + +Handlebars.registerHelper "isUserSharingAudio", (u) -> + u.voiceUser.talking + +Handlebars.registerHelper "isUserSharingVideo", (u) -> + u.webcam_stream.length isnt 0 + diff --git a/labs/meteor-client/client/main.html b/labs/meteor-client/client/main.html index 0a1e253db5..1b4e429f97 100755 --- a/labs/meteor-client/client/main.html +++ b/labs/meteor-client/client/main.html @@ -33,13 +33,13 @@ {{> makeButton id=user.externUserId btn_class="chatBarIcon navbar-brand" i_class="comment" _id=_id}} {{/if}} - {{#if user.sharingVideo}} + {{#if isUserSharingVideo user}} {{> makeButton id=user.externUserId btn_class="navbarIconToggleActive videoFeedIcon navbar-brand" i_class="facetime-video" sharingVideo=true _id=_id}} {{else}} {{> makeButton id=user.externUserId btn_class="videoFeedIcon navbar-brand" i_class="stop" sharingVideo=false _id=_id}} {{/if}} - {{#if user.sharingAudio}} + {{#if isUserSharingAudio user}} {{> makeButton id=user.externUserId btn_class="navbarIconToggleActive audioFeedIcon navbar-brand" i_class="volume-up" sharingAudio=true _id=_id}} {{else}} {{> makeButton id=user.externUserId btn_class="audioFeedIcon navbar-brand" i_class="volume-off" sharingAudio=false _id=_id}} diff --git a/labs/meteor-client/client/views/users/user_item.html b/labs/meteor-client/client/views/users/user_item.html index ba8b660ee8..82cd3fe1f5 100755 --- a/labs/meteor-client/client/views/users/user_item.html +++ b/labs/meteor-client/client/views/users/user_item.html @@ -37,14 +37,14 @@