diff --git a/web/app/assets/javascripts/fakeJamClient.js b/web/app/assets/javascripts/fakeJamClient.js index 81826b5eb..98b64917b 100644 --- a/web/app/assets/javascripts/fakeJamClient.js +++ b/web/app/assets/javascripts/fakeJamClient.js @@ -96,6 +96,14 @@ return {} } + function FTUESetSendFrameRates(fps) { + + } + + function FTUEGetSendFrameRates() { + return {20:20, 24:24, 30:30} + } + function isSessVideoShared() { return videoShared; } @@ -1226,6 +1234,8 @@ this.FTUECurrentSelectedVideoDevice = FTUECurrentSelectedVideoDevice; this.FTUEGetAvailableEncodeVideoResolutions = FTUEGetAvailableEncodeVideoResolutions; this.FTUEGetVideoCaptureDeviceCapabilities = FTUEGetVideoCaptureDeviceCapabilities; + this.FTUEGetSendFrameRates = FTUEGetSendFrameRates; + this.FTUESetSendFrameRates = FTUESetSendFrameRates; this.isSessVideoShared = isSessVideoShared; diff --git a/web/app/assets/javascripts/webcam_viewer.js.coffee b/web/app/assets/javascripts/webcam_viewer.js.coffee index a5538167a..21c95c5a8 100644 --- a/web/app/assets/javascripts/webcam_viewer.js.coffee +++ b/web/app/assets/javascripts/webcam_viewer.js.coffee @@ -2,6 +2,21 @@ $ = jQuery context = window context.JK ||= {}; +BackendToFrontend = { + "QCIF (176X144)" : "QCIF (176X144)", + "CIF (352X288)" : "CIF (352X288)", + "VGA (640X480)" : "VGA (640X480)", + "4CIF (704X576)" : "4CIF (704X576)", + "1/2WHD (640X360)" : "1/2WHD (640X360)", + "WHD (1280X720)": "WHD (1280X720)", + "FHD (1920x1080)" : "FHD (1920x1080)" +} + + +FrontendToBackend = {} +for key, value of BackendToFrontend + FrontendToBackend[value] = key + context.JK.WebcamViewer = class WebcamViewer constructor: (@root) -> @client = context.jamClient @@ -52,8 +67,15 @@ context.JK.WebcamViewer = class WebcamViewer @logger.debug 'Selecting from res control: ', @resolutionSelect @resolution = @resolutionSelect.val() if @resolution? - @logger.debug 'Selecting webcam resolution: ', @resolution - @client.FTUESetVideoEncodeResolution @resolution + bits = @resolution.split('|') + selectedResolution = bits[0] + selectedFps = bits[1] + @logger.debug 'Selecting webcam resolution: ', selectedResolution + @logger.debug 'Selecting webcam fps: ', selectedFps + + @client.FTUESetVideoEncodeResolution selectedResolution + @client.FTUESetSendFrameRates selectedFps + # if @isVideoShared # this.setVideoOff() # this.toggleWebcam() @@ -113,13 +135,26 @@ context.JK.WebcamViewer = class WebcamViewer loadResolutions:() => # protect against non-video clients pointed at video-enabled server from getting into a session resolutions = if @client.FTUEGetAvailableEncodeVideoResolutions? then @client.FTUEGetAvailableEncodeVideoResolutions() else {} + frames = if @client.FTUEGetSendFrameRates? then @client.FTUEGetSendFrameRates() else {} selectControl = @resolutionSelect - @logger.debug 'FOUND THESE RESOLUTIONS', resolutions, selectControl - context._.each resolutions, (value, key, obj) -> - option = $('