Fixed ,ajor issues with duplication of button handler preventing audio calls from being made

This commit is contained in:
perroned 2014-08-15 09:26:17 -07:00
parent 7eb22d415f
commit 85e9d888d1
7 changed files with 54 additions and 74 deletions

View File

@ -146,25 +146,27 @@ Meteor.methods
setInSession "display_usersList", !getInSession "display_usersList"
@toggleVoiceCall = (event) ->
if getInSession "isSharingAudio"
callback = ->
setInSession "isSharingAudio", false # update to no longer sharing
console.log "left voice conference"
# sometimes we can hangup before the message that the user stopped talking is received so lets set it manually, otherwise they might leave the audio call but still be registered as talking
Meteor.call("userStopAudio", getInSession("meetingId"),getInSession("userId"))
webrtc_hangup callback # sign out of call
else
# create voice call params
username = "#{getInSession("userId")}-bbbID-#{getUsersName()}"
voiceBridge = "70827"
server = null
callback = (message) ->
console.log JSON.stringify message
setInSession "isSharingAudio", true
Meteor.call("userShareAudio", getInSession("meetingId"),getInSession("userId"))
console.log "joined audio call"
console.log Meteor.Users.findOne(userId:getInSession("userId"))
webrtc_call(username, voiceBridge, server, callback) # make the call
if getInSession "isSharingAudio"
hangupCallback = ->
console.log "left voice conference"
# sometimes we can hangup before the message that the user stopped talking is received so lets set it manually, otherwise they might leave the audio call but still be registered as talking
Meteor.call("userStopAudio", getInSession("meetingId"),getInSession("userId"))
setInSession "isSharingAudio", false # update to no longer sharing
webrtc_hangup hangupCallback # sign out of call
else
# create voice call params
username = "#{getInSession("userId")}-bbbID-#{getUsersName()}"
# voiceBridge = "70827"
voiceBridge = "70828"
server = null
joinCallback = (message) ->
console.log JSON.stringify message
Meteor.call("userShareAudio", getInSession("meetingId"),getInSession("userId"))
console.log "joined audio call"
console.log Meteor.Users.findOne(userId:getInSession("userId"))
setInSession "isSharingAudio", true
webrtc_call(username, voiceBridge, server, joinCallback) # make the call
return false
@toggleWhiteBoard = ->
setInSession "display_whiteboard", !getInSession "display_whiteboard"
@ -172,10 +174,6 @@ Meteor.methods
@userKick = (meeting, user) ->
Meteor.call("userKick", meeting, user)
Handlebars.registerHelper "isUserSharingAudio", (u) ->
if u? then u.voiceUser?.joined
else return false
Handlebars.registerHelper "getCurrentSlide", ->
currentPresentation = Meteor.Presentations.findOne({"presentation.current": true})
presentationId = currentPresentation?.presentation?.id

View File

@ -76,32 +76,3 @@ Meteor.startup ->
]
@whiteboardPaperModel = new WhiteboardPaperModel('whiteboard-paper')
Template.header.events
"click .usersListIcon": (event) ->
toggleUsersList()
"click .chatBarIcon": (event) ->
toggleChatbar()
"click .videoFeedIcon": (event) ->
toggleCam @
"click .audioFeedIcon": (event) ->
toggleVoiceCall @
"click .muteIcon": (event) ->
toggleMic @
"click .signOutIcon": (event) ->
userLogout getInSession("meetingId"), getInSession("userId"), true
"click .hideNavbarIcon": (event) ->
toggleNavbar()
"click .settingsIcon": (event) ->
alert "settings"
"click .raiseHand": (event) ->
Meteor.call('userRaiseHand', @id)
"click .whiteboardIcon": (event) ->
toggleWhiteBoard()
Template.makeButton.rendered = ->
$('button[rel=tooltip]').tooltip()
# Gets called last in main template, just an easy place to print stuff out
Handlebars.registerHelper "doFinalStuff", ->
console.log "-----Doing Final Stuff-----"

View File

@ -80,25 +80,25 @@
</template>
<template name="main">
<head><title>BigBlueButton Meteor</title></head>
<body>
<div id="main" class="mainContainer row-fluid">
<div>{{> header}}</div>
{{> usersList id="users" name="usersList"}}
{{> whiteboard id="whiteboardContainer" title="Whiteboard" name="whiteboard"}}
{{> chatbar id="chat" title="Chat" name="chatbar"}}
<audio id="remote-media" autoplay="autoplay"></audio>
{{> footer}}
{{doFinalStuff}}
</div>
</body>
<head><title>BigBlueButton Meteor</title></head>
<body>
<div id="main" class="mainContainer row-fluid">
<div>{{> header}}</div>
{{> usersList id="users" name="usersList"}}
{{> whiteboard id="whiteboardContainer" title="Whiteboard" name="whiteboard"}}
{{> chatbar id="chat" title="Chat" name="chatbar"}}
<audio id="remote-media" autoplay="autoplay"></audio>
{{> footer}}
{{doFinalStuff}}
</div>
</body>
</template>
<template name="recordingStatus">
<!-- Recording status of the meeting -->
{{#if meetingIsRecording}}
<button class="recordingStatusTrue" rel="tooltip" data-placement="bottom" title="This Meeting is Being Recorded"><span class="glyphicon glyphicon-record"></span> Recording</button>
<button class="recordingStatus recordingStatusTrue" rel="tooltip" data-placement="bottom" title="This Meeting is Being Recorded"><span class="glyphicon glyphicon-record"></span> Recording</button>
{{else}}
<button class="recordingStatusFalse" rel="tooltip" data-placement="bottom" title="This Meeting is Not Being Recorded"><span class="glyphicon glyphicon-record"></span></button>
<button class="recordingStatus recordingStatusFalse" rel="tooltip" data-placement="bottom" title="This Meeting is Not Being Recorded"><span class="glyphicon glyphicon-record"></span></button>
{{/if}}
</template>

View File

@ -57,7 +57,10 @@
width: 80%;
margin-top:6px;
}
.optionsChatTab{}
.optionsBar{
padding-top:15px;
padding-left: 15px;
}
.panel-footer{
padding-top:0px;
position:relative;
@ -69,7 +72,6 @@
border: solid 1px grey;
padding: 5px;
width: 90%;
margin-left:15px;
}
.private-chat-user-entry {}
.private-chat-user-list {

View File

@ -1,8 +1,13 @@
.audioFeedIcon{}
body {
background: #eee;
bottom:0;
color: #666666;
position:absolute; top:0; bottom:0; left:0; right:0; height:100%;
height:100%;
left:0;
position:absolute;
right:0;
top:0;
}
.chatBarIcon{}
@ -78,17 +83,17 @@ body {
padding-left:0.5%;
}
.raiseHand {}
.recordingStatusTrue{
color:green;
.recordingStatus{
background:none!important;
border:none;
padding:0!important;
margin-left: 10px;
}
.recordingStatusTrue{
color:green;
}
.recordingStatusFalse{
color:maroon;
background:none!important;
border:none;
padding:0!important;
}
.ScrollableWindow {
height: 100%;

View File

@ -5,6 +5,7 @@
}
#user-contents {
padding-bottom: 10px;
height:95%;
}
.userNameEntry{
height:20px;

View File

@ -101,6 +101,9 @@ Template.optionsBar.events
"from_color": "0"
Meteor.call "sendChatMessagetoServer", getInSession("meetingId"), messageForServer
Template.optionsBar.rendered = ->
$('div[rel=tooltip]').tooltip()
Template.tabButtons.events
'click .close': (event) -> # user closes private chat
setInSession 'inChatWith', 'PUBLIC_CHAT'