diff --git a/db/manifest b/db/manifest index 52c9b9495..a3c6bebbe 100755 --- a/db/manifest +++ b/db/manifest @@ -304,3 +304,4 @@ jam_track_searchability.sql harry_fox_agency.sql jam_track_slug.sql mixdown.sql +video_recording.sql diff --git a/db/up/video_recording.sql b/db/up/video_recording.sql new file mode 100644 index 000000000..44a976d30 --- /dev/null +++ b/db/up/video_recording.sql @@ -0,0 +1 @@ +ALTER TABLE recordings ADD video BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file diff --git a/ruby/lib/jam_ruby/models/recording.rb b/ruby/lib/jam_ruby/models/recording.rb index 92a25aa93..1ec43b9aa 100644 --- a/ruby/lib/jam_ruby/models/recording.rb +++ b/ruby/lib/jam_ruby/models/recording.rb @@ -213,7 +213,7 @@ module JamRuby recording.music_session = music_session recording.owner = owner recording.band = music_session.band - recording.record_video = record_video + recording.video = record_video if recording.save GoogleAnalyticsEvent.report_band_recording(recording.band) diff --git a/web/app/assets/javascripts/dialog/recordingFinishedDialog.js b/web/app/assets/javascripts/dialog/recordingFinishedDialog.js index cceaaedc2..3b4b92f07 100644 --- a/web/app/assets/javascripts/dialog/recordingFinishedDialog.js +++ b/web/app/assets/javascripts/dialog/recordingFinishedDialog.js @@ -13,6 +13,12 @@ // remove all display errors $('#recording-finished-dialog form .error-text').remove() $('#recording-finished-dialog form .error').removeClass("error") + if(recording.video) { + $dialog.find('.save-video').show() + } + else { + $dialog.find('.save-video').hide() + } removeGoogleLoginErrors() } diff --git a/web/app/assets/javascripts/react-components/PopupRecordingStartStop.js.jsx.coffee b/web/app/assets/javascripts/react-components/PopupRecordingStartStop.js.jsx.coffee index d13f69dc6..09295a5ad 100644 --- a/web/app/assets/javascripts/react-components/PopupRecordingStartStop.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/PopupRecordingStartStop.js.jsx.coffee @@ -1,4 +1,5 @@ context = window +logger = context.JK.logger mixins = [] @@ -26,9 +27,23 @@ if accessOpener if this.state.isRecording window.opener.RecordingActions.stopRecording() else - window.opener.RecordingActions.startRecording() + recordChat = false + recordVideo = false + + if @inputType != 'audio-only' + recordVideo = true + + if @audioType != 'audio-only' + recordChat = true + + logger.debug("@inputType, @udiotye", @inputType, @audioType) + window.opener.RecordingActions.startRecording(recordVideo, recordChat) onNoteShowHide: () -> + + $root = $(this.getDOMNode()) + audioVideoValue = $root.find('input[name="recording-input-type"]').val() + console.log("audio video value", audioVideoValue) this.setState(showNote: !this.state.showNote) getInitialState: () -> @@ -53,16 +68,34 @@ if accessOpener ` - recordingJSX = `
-
- - -
+ recordingJSX = + `
+
+

Video Settings

+
+ + +
+
+
+ + +
+
-
- - -
+ +
+

Audio Settings

+
+ + +
+
+
+ + +
+
` @@ -108,6 +141,16 @@ if accessOpener windowUnloaded: () -> window.opener.RecordingActions.recordingControlsClosed() + trackInputType: (e) -> + $checkedType = $(e.target); + @inputType = $checkedType.val() + logger.debug("updated @inputType",e.target, @inputType) + + trackAudioType: (e) -> + $checkedType = $(e.target); + @audioType = $checkedType.val() + logger.debug("updated @audioType", @inputType) + componentDidMount: () -> $(window).unload(@windowUnloaded) @@ -116,6 +159,12 @@ if accessOpener $recordingType = $root.find('input[type="radio"]') context.JK.checkbox($recordingType) + @inputType = 'audio-only' + @audioType = 'audio-only' + + $root.find('input[name="recording-input-type"]').on('ifChanged', @trackInputType) + $root.find('input[name="recording-input-chat-option"]').on('ifChanged', @trackAudioType) + @resizeWindow() # this is necessary due to whatever the client's rendering behavior is. diff --git a/web/app/assets/javascripts/react-components/stores/RecordingStore.js.jsx.coffee b/web/app/assets/javascripts/react-components/stores/RecordingStore.js.jsx.coffee index c16809856..d36593d48 100644 --- a/web/app/assets/javascripts/react-components/stores/RecordingStore.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/stores/RecordingStore.js.jsx.coffee @@ -23,8 +23,12 @@ logger = context.JK.logger @recordingModel = recordingModel this.trigger({isRecording: @recordingModel.isRecording()}) - onStartRecording: (recordingVideo, recordChat) -> - @recordingModel.startRecording(recordVideo, recordChat) + onStartRecording: (recordVideo, recordChat) -> + + frameRate = context.jamClient.GetCurrentVideoFrameRate() || 30; + + logger.debug("onStartRecording: recordVideo: #{recordVideo}, recordChat: #{recordChat} frameRate: #{frameRate}") + @recordingModel.startRecording(recordVideo, recordChat, frameRate) onStopRecording: () -> @recordingModel.stopRecording() diff --git a/web/app/assets/javascripts/recordingModel.js b/web/app/assets/javascripts/recordingModel.js index 29f13dc40..2b8ea3a4b 100644 --- a/web/app/assets/javascripts/recordingModel.js +++ b/web/app/assets/javascripts/recordingModel.js @@ -88,7 +88,7 @@ context.RecordingActions.startingRecording({isRecording: false}) - currentRecording = rest.startRecording({"music_session_id": sessionId, recordVideo: recordVideo}) + currentRecording = rest.startRecording({"music_session_id": sessionId, record_video: recordVideo}) .done(function(recording) { currentRecordingId = recording.id; currentOrLastRecordingId = recording.id; diff --git a/web/app/assets/stylesheets/minimal/recording_controls.css.scss b/web/app/assets/stylesheets/minimal/recording_controls.css.scss index b2817b8ee..0b1cb54cc 100644 --- a/web/app/assets/stylesheets/minimal/recording_controls.css.scss +++ b/web/app/assets/stylesheets/minimal/recording_controls.css.scss @@ -59,10 +59,10 @@ body.recording-start-stop { .field { height:18px; - &:nth-child(1) { + &:nth-of-type(1) { } - &:nth-child(2) { + &:nth-of-type(2) { margin-top:9px; } } @@ -83,6 +83,16 @@ body.recording-start-stop { width:260px; } + h3 { + font-size:14px; + font-weight:bold; + margin-bottom:6px; + } + + .video-settings { + margin-bottom:20px; + } + a.note-show-hide { margin-top:5px; text-decoration:underline; diff --git a/web/app/views/api_recordings/show.rabl b/web/app/views/api_recordings/show.rabl index d59732cb3..285d7bbb6 100644 --- a/web/app/views/api_recordings/show.rabl +++ b/web/app/views/api_recordings/show.rabl @@ -1,6 +1,6 @@ object @recording -attributes :id, :band, :created_at, :duration, :comment_count, :like_count, :play_count, :when_will_be_discarded?, :jam_track_id, :jam_track_initiator_id, :music_session_id, :music_session +attributes :id, :band, :created_at, :duration, :comment_count, :like_count, :play_count, :when_will_be_discarded?, :jam_track_id, :jam_track_initiator_id, :music_session_id, :music_session, :video node :fan_access do |recording| recording.non_active_music_session.fan_access diff --git a/web/app/views/dialogs/_recordingFinishedDialog.html.haml b/web/app/views/dialogs/_recordingFinishedDialog.html.haml index bbbdfa701..ad8f37919 100644 --- a/web/app/views/dialogs/_recordingFinishedDialog.html.haml +++ b/web/app/views/dialogs/_recordingFinishedDialog.html.haml @@ -25,10 +25,10 @@ %br/ %textarea#claim-recording-description.w100{:name => "description"} -if (Rails.application.config.video_available=="full") || (current_user && current_user.admin) - .field.left{:purpose => "save_video"} + .save-video.field.left{:purpose => "save_video"} %input{:name => "save_video", :type => "checkbox"}/ %label{:for => "save_video"} Save Video to Computer - .field.left{:purpose => "upload_to_youtube"} + .hidden.field.left{:purpose => "upload_to_youtube"} %span %input{:name => "upload_to_youtube", :type => "checkbox"}/ %label{:for => "upload_to_youtube"} Upload Video to YouTube