From 795f0b5375dfc6531e55f26b1cc69922887ae44d Mon Sep 17 00:00:00 2001 From: Seth Call Date: Mon, 10 Aug 2015 11:05:24 -0500 Subject: [PATCH] * allow a non-video client into a session on a server configured with video --- ruby/lib/jam_ruby/models/jam_track.rb | 2 +- web/app/assets/javascripts/webcam_viewer.js.coffee | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ruby/lib/jam_ruby/models/jam_track.rb b/ruby/lib/jam_ruby/models/jam_track.rb index 7f1e66e1b..244cbc6f1 100644 --- a/ruby/lib/jam_ruby/models/jam_track.rb +++ b/ruby/lib/jam_ruby/models/jam_track.rb @@ -19,7 +19,7 @@ module JamRuby :licensor_royalty_amount, :pro_royalty_amount, :plan_code, :initial_play_silence, :jam_track_tracks_attributes, :jam_track_tap_ins_attributes, :genre_ids, :version, :jmep_json, :jmep_text, :pro_ascap, :pro_bmi, :pro_sesac, :duration, as: :admin - validates :name, presence: true, uniqueness: true, length: {maximum: 200} + validates :name, presence: true, length: {maximum: 200} validates :plan_code, presence: true, uniqueness: true, length: {maximum: 50 } validates :description, length: {maximum: 1000} validates :time_signature, inclusion: {in: [nil] + [''] + TIME_SIGNATURES} # the empty string is needed because of activeadmin diff --git a/web/app/assets/javascripts/webcam_viewer.js.coffee b/web/app/assets/javascripts/webcam_viewer.js.coffee index 87e6a7f93..a5538167a 100644 --- a/web/app/assets/javascripts/webcam_viewer.js.coffee +++ b/web/app/assets/javascripts/webcam_viewer.js.coffee @@ -32,7 +32,9 @@ context.JK.WebcamViewer = class WebcamViewer this.loadResolutions() this.selectResolution() @initialScan = true - @client.SessStopVideoSharing() + # protect against non-video clients pointed at video-enabled server from getting into a session + if @client.SessStopVideoSharing + @client.SessStopVideoSharing() #client.SessSetInsetPosition(5) #client.SessSetInsetSize(1) #client.FTUESetAutoSelectVideoLayout(false) @@ -82,14 +84,16 @@ context.JK.WebcamViewer = class WebcamViewer selectedDeviceName:() => webcamName="None Configured" - webcam = @client.FTUECurrentSelectedVideoDevice() + # protect against non-video clients pointed at video-enabled server from getting into a session + webcam = if @client.FTUECurrentSelectedVideoDevice? then @client.FTUECurrentSelectedVideoDevice() else null if (webcam? && Object.keys(webcam).length>0) webcamName = _.values(webcam)[0] webcamName loadWebCams:() => - devices = @client.FTUEGetVideoCaptureDeviceNames() + # protect against non-video clients pointed at video-enabled server from getting into a session + devices = if @client.FTUEGetVideoCaptureDeviceNames? then @client.FTUEGetVideoCaptureDeviceNames() else [] selectedDevice = this.selectedDeviceName() selectControl = @webcamSelect context._.each devices, (device) -> @@ -107,7 +111,8 @@ context.JK.WebcamViewer = class WebcamViewer @root.find('.no-webcam-msg').addClass 'hidden' loadResolutions:() => - resolutions = @client.FTUEGetAvailableEncodeVideoResolutions() + # protect against non-video clients pointed at video-enabled server from getting into a session + resolutions = if @client.FTUEGetAvailableEncodeVideoResolutions? then @client.FTUEGetAvailableEncodeVideoResolutions() else {} selectControl = @resolutionSelect @logger.debug 'FOUND THESE RESOLUTIONS', resolutions, selectControl context._.each resolutions, (value, key, obj) ->