2015-09-16 00:34:59 +08:00
|
|
|
Template.vertoDeskshareMenu.events
|
2015-09-14 22:07:35 +08:00
|
|
|
"click .vertoButton": (event) ->
|
|
|
|
$("#settingsModal").foundation('reveal', 'close')
|
|
|
|
|
2015-09-16 00:34:59 +08:00
|
|
|
"click .screenshareShow": (event) ->
|
|
|
|
$("#deskshareModal").foundation('reveal', 'open');
|
|
|
|
$("#screenshareShow").hide()
|
|
|
|
$("#screenshareHide").show()
|
|
|
|
|
|
|
|
"click .screenshareHide": (event) ->
|
2015-09-16 03:06:18 +08:00
|
|
|
if(!!window["deskshareStream"])
|
|
|
|
$("#webcam").src = null;
|
|
|
|
window["deskshareStream"].stop();
|
|
|
|
else
|
|
|
|
screenStart(false, (->))
|
2015-10-01 00:57:44 +08:00
|
|
|
console.log("ending simulation");
|
|
|
|
simulatePresenterDeskshareHasEnded();
|
2015-09-16 03:06:18 +08:00
|
|
|
|
2015-09-16 00:34:59 +08:00
|
|
|
$("#screenshareShow").show()
|
|
|
|
$("#screenshareHide").hide()
|
2015-09-16 03:06:18 +08:00
|
|
|
$("#screenshareStart").show()
|
|
|
|
$("#screenshareStop").hide()
|
2015-09-16 00:34:59 +08:00
|
|
|
|
2015-09-23 00:09:29 +08:00
|
|
|
"click #screenshareSubscribe": (event) ->
|
|
|
|
joinVoiceCall @, {
|
|
|
|
watchOnly: true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
|
2015-09-16 00:34:59 +08:00
|
|
|
Template.deskshareModal.events
|
2015-09-14 22:07:35 +08:00
|
|
|
"click .screenshareStart": (event) ->
|
2015-09-16 00:34:59 +08:00
|
|
|
$("#deskshareModal").foundation('reveal', 'close')
|
|
|
|
$("#screenshareStart").hide()
|
2015-09-16 03:06:18 +08:00
|
|
|
$("#screenshareStop").show()
|
2015-10-01 00:57:44 +08:00
|
|
|
screenStart(true, ((m)-> console.log(m)), "webcam")
|
2015-09-14 22:07:35 +08:00
|
|
|
|
|
|
|
"click .screenshareStop": (event) ->
|
2015-09-16 00:34:59 +08:00
|
|
|
$("#deskshareModal").foundation('reveal', 'close')
|
|
|
|
$("#screenshareStart").show()
|
|
|
|
$("#screenshareStop").hide()
|
2015-09-14 22:07:35 +08:00
|
|
|
screenStart(false, (->))
|
2015-09-05 03:27:46 +08:00
|
|
|
|
2015-09-16 00:34:59 +08:00
|
|
|
"click #desksharePreview": (event) ->
|
|
|
|
doDesksharePreview((->), (->), "webcam");
|
|
|
|
|
2015-09-16 03:06:18 +08:00
|
|
|
Template.vertoWebcamMenu.events
|
|
|
|
"click .vertoButton": (event) ->
|
|
|
|
$("#settingsModal").foundation('reveal', 'close')
|
|
|
|
|
|
|
|
"click .webcamShow": (event) ->
|
|
|
|
$("#webcamModal").foundation('reveal', 'open');
|
|
|
|
$("#webcamShow").hide()
|
|
|
|
$("#webcamHide").show()
|
|
|
|
|
|
|
|
"click .webcamHide": (event) ->
|
|
|
|
if(!!window["webcamStream"])
|
|
|
|
$("#webcam").src = null;
|
|
|
|
window["webcamStream"].stop();
|
|
|
|
|
|
|
|
$("#webcamShow").show()
|
|
|
|
$("#webcamHide").hide()
|
|
|
|
|
|
|
|
Template.webcamModal.events
|
2015-09-16 00:34:59 +08:00
|
|
|
"click .webcamStart": (event) ->
|
|
|
|
$("#webcamModal").foundation('reveal', 'open');
|
|
|
|
$("#webcamStart").hide()
|
|
|
|
$("#webcamStop").show()
|
|
|
|
|
|
|
|
"click .webcamStop": (event) ->
|
|
|
|
$("#webcamStart").show()
|
|
|
|
$("#webcamStop").hide()
|
|
|
|
|
2015-09-16 03:06:18 +08:00
|
|
|
"click #webcamPreview": (event) ->
|
|
|
|
doWebcamPreview((->), (->), "webcam");
|
|
|
|
|
|
|
|
"click #getAdjustedResolutions": (event) ->
|
|
|
|
getAdjustedResolutions (result) ->
|
|
|
|
for i of result
|
|
|
|
$("#adjustedResolutions").append(i + ": " + result[i].width + "x" + result[i].height + "<br/>")
|
2015-09-14 22:07:35 +08:00
|
|
|
|
|
|
|
@toggleWhiteboardVideo = (display) ->
|
|
|
|
if display is "whiteboard"
|
2015-10-08 21:14:23 +08:00
|
|
|
$("#videoContainer").css("display", "none")
|
2015-09-14 22:07:35 +08:00
|
|
|
$("#whiteboard-container").css("display", "block")
|
|
|
|
else if display is "video"
|
|
|
|
$("#whiteboard-container").css("display", "none")
|
2015-10-08 21:14:23 +08:00
|
|
|
$("#videoContainer").css("display", "block")
|
|
|
|
$("#videoContainer").css("width", "100%")
|
|
|
|
$("#videoContainer").css("height", "100%")
|
2015-09-14 22:07:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# "click #hangUp": (event) ->
|
|
|
|
# leaveWebRTCVoiceConference_verto();
|
|
|
|
# cur_call = null;
|
|
|
|
|
|
|
|
# "click #joinAudio": (event) ->
|
|
|
|
# # displayVertoVideo()
|
|
|
|
# toggleWhiteboardVideo("video")
|
|
|
|
# # return
|
|
|
|
# wasCallSuccessful = false
|
|
|
|
# debuggerCallback = (message) ->
|
|
|
|
# console.log("CALLBACK: "+JSON.stringify(message));
|
|
|
|
# #
|
|
|
|
# # Beginning of hacky method to make Firefox media calls succeed.
|
|
|
|
# # Always fail the first time. Retry on failure.
|
|
|
|
# #
|
|
|
|
# if !!navigator.mozGetUserMedia and message.errorcode is 1001
|
|
|
|
# callIntoConference_verto(extension, conferenceUsername, conferenceIdNumber, ((m) -> console.log("CALLBACK: "+JSON.stringify(m))), "webcam")
|
|
|
|
# #
|
|
|
|
# # End of hacky method
|
|
|
|
# #
|
|
|
|
# callIntoConference_verto(extension, conferenceUsername, conferenceIdNumber, debuggerCallback, "webcam");
|
2015-10-01 00:57:44 +08:00
|
|
|
|
|
|
|
# if remote deskshare has been ended disconnect and hide the video stream
|
|
|
|
@presenterDeskshareHasEnded = ->
|
|
|
|
toggleWhiteboardVideo("whiteboard")
|
2015-10-01 02:04:01 +08:00
|
|
|
exitVoiceCall()
|
2015-10-01 00:57:44 +08:00
|
|
|
console.log("deskshare Ended")
|
|
|
|
|
|
|
|
# if remote deskshare has been started connect and display the video stream
|
|
|
|
@presenterDeskshareHasStarted = ->
|
|
|
|
toggleWhiteboardVideo("video")
|
|
|
|
console.log("deskshare started")
|
|
|
|
joinVoiceCall @, {
|
|
|
|
watchOnly: true
|
|
|
|
}
|
|
|
|
|
|
|
|
# instead of a redis message notify the server to simulate a desksharing
|
|
|
|
# notification
|
|
|
|
@simulatePresenterDeskshareHasStarted = ->
|
|
|
|
console.log("Calling pres desk started on the server");
|
|
|
|
Meteor.call("simulatePresenterDeskshareHasStarted", getInSession("meetingId"), "12345", getInSession("userId"))
|
|
|
|
|
|
|
|
@simulatePresenterDeskshareHasEnded = ->
|
|
|
|
console.log("calling server to end deskshare")
|
|
|
|
Meteor.call("simulatePresenterDeskshareHasEnded", getInSession("meetingId"), getInSession("userId"))
|