* decommision webcam_viewer in session page

This commit is contained in:
Seth Call 2015-09-11 13:40:34 -05:00
parent ac1cc0c828
commit 3e27680ea9
5 changed files with 16 additions and 12 deletions

View File

@ -47,7 +47,11 @@
if(gon.global.video_available && gon.global.video_available!="none" ) {
var webcamName;
var webcam = context.jamClient.FTUECurrentSelectedVideoDevice()
var webcam = null;
if (context.jamClient.FTUECurrentSelectedVideoDevice) {
webcam = context.jamClient.FTUECurrentSelectedVideoDevice()
}
if (webcam == null || typeof(webcam) == "undefined" || Object.keys(webcam).length == 0) {
webcamName = "None Configured"
} else {

View File

@ -9,6 +9,7 @@ JamTrackActions = @JamTrackActions
SessionActions = @SessionActions
RecordingActions = @RecordingActions
NotificationActions = @NotificationActions
VideoActions = @VideoActions
@SessionStore = Reflux.createStore(
{
@ -52,11 +53,6 @@ NotificationActions = @NotificationActions
RecordingActions.initModel(@recordingModel)
@helper = new context.SessionHelper(@app, @currentSession, @participantsEverSeen, @isRecording, @downloadingJamTrack)
if gon.global.video_available && gon.global.video_available!="none" && context.JK.WebcamViewer?
@webcamViewer = new context.JK.WebcamViewer()
$sessionLayout = $("#create-session-layout")
@webcamViewer.init($sessionLayout, false)
@webcamViewer.setVideoOff()
onVideoChanged: (@videoState) ->
@ -188,7 +184,7 @@ NotificationActions = @NotificationActions
if @videoState?.videoEnabled
logger.debug("toggle session video")
@webcamViewer.toggleWebcam() if @webcamViewer?
VideoActions.toggleVideo()
else
context.JK.Banner.showAlert({
title: "Video Is Disabled",
@ -570,8 +566,7 @@ NotificationActions = @NotificationActions
shareDialog.initialize(context.JK.FacebookHelperInstance);
# initialize webcamViewer
if gon.global.video_available && gon.global.video_available != "none"
@webcamViewer.beforeShow()
VideoActions.stopVideo();
# double-check that we are connected to the server via websocket
@ -985,8 +980,7 @@ NotificationActions = @NotificationActions
logger.warn("no location specified in leaveSession action", behavior)
window.location = '/client#/home'
if gon.global.video_available && gon.global.video_available != "none"
@webcamViewer.beforeHide()
VideoActions.stopVideo()
@leaveSession()

View File

@ -117,6 +117,8 @@ BackendToFrontendFPS = {
@onRefresh()
onStartVideo: ->
return unless context.jamClient.SessStartVideoSharing?
if @howtoWindow?
@howtoWindow.close()
@howtoWindow = null
@ -166,6 +168,9 @@ BackendToFrontendFPS = {
onSelectDevice: (device, caps) ->
# don't do anything if no video capabilities
return unless context.jamClient.FTUESelectVideoCaptureDevice?
result = context.jamClient.FTUESelectVideoCaptureDevice(device, caps)
if(!result)
@logger.error("onSelectDevice failed with device #{device}")

View File

@ -101,7 +101,6 @@ mixins.push(Reflux.listenTo(VideoStore, 'onVideoStateChanged'))
# protect against non-video clients pointed at video-enabled server from getting into a session
resolutions = @state.encodeResolutions
frames = @state.frameRates
@logger.debug("Webcam state on render", @state)
context._.each resolutions, (resolution, resolutionKey, obj) =>
#{1: "CIF (352X288)", 2: "VGA (640X480)", 3: "4CIF (704X576)", 4: "1/2WHD (640X360)", 5: "WHD (1280X720)", 6: "FHD (1920x1080)"}

View File

@ -70,6 +70,7 @@ context.JK.WebcamViewer = class WebcamViewer
@videoSettingsHelp.click(false)
beforeShow:() =>
@videoShared = false # video can be assumed to be closed before htis is reached
this.loadWebCams()
this.selectWebcam()
@ -174,6 +175,7 @@ context.JK.WebcamViewer = class WebcamViewer
@videoShared = false
else
@toggleBtn.addClass("selected")
alert("HERE?")
@client.SessStartVideoSharing 0
@videoShared = true