diff --git a/web/app/assets/javascripts/JamServer.js b/web/app/assets/javascripts/JamServer.js
index 156dccdee..f150b12cf 100644
--- a/web/app/assets/javascripts/JamServer.js
+++ b/web/app/assets/javascripts/JamServer.js
@@ -49,6 +49,8 @@
var connectTimeout = null;
var activityTimeout;
+
+
// elements
var $inSituBanner = null;
var $inSituBannerHolder = null;
diff --git a/web/app/assets/javascripts/asyncJamClient.js b/web/app/assets/javascripts/asyncJamClient.js
index 19ae776a4..a712930b5 100644
--- a/web/app/assets/javascripts/asyncJamClient.js
+++ b/web/app/assets/javascripts/asyncJamClient.js
@@ -531,6 +531,7 @@
logger.log(`3010 JKVideoSession: ${response['JKVideoSession']['connect']}`);
const vidConnect = response['JKVideoSession']['connect'];
context.ExternalVideoActions.setVideoEnabled(vidConnect);
+ context.JK.videoIsOngoing = vidConnect;
break;
default:
break;
diff --git a/web/app/assets/javascripts/jamkazam.js b/web/app/assets/javascripts/jamkazam.js
index 1e86c3d2a..c3cbe1f88 100644
--- a/web/app/assets/javascripts/jamkazam.js
+++ b/web/app/assets/javascripts/jamkazam.js
@@ -474,6 +474,9 @@
this.clientId = null;
this.initialRouting = initialRouting;
+ //video server
+ this.videoIsOngoing = false;
+
$(document).triggerHandler('JAMKAZAM_CONSTRUCTED', {app:this})
return this;
};
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 c951f7c27..88f19dab5 100644
--- a/web/app/assets/javascripts/react-components/PopupRecordingStartStop.js.jsx.coffee
+++ b/web/app/assets/javascripts/react-components/PopupRecordingStartStop.js.jsx.coffee
@@ -45,16 +45,14 @@ if accessOpener
mixins: mixins
- getInitialState: () ->
- { videoEnabled: false }
-
onExternalVideoStateChanged: (videoState) ->
- unless videoState.videoEnabled
- $root = $(this.getDOMNode())
- $root.find('#recording-input-audio').iCheck('check').attr('checked', 'checked')
- this.setState(videoState)
+ $root = $(this.getDOMNode())
+ if videoState.videoEnabled
+ $root.find('#recording-input-both').iCheck('uncheck').attr('disabled', false)
+ else
+ $root.find('#recording-input-both').prop('disabled',true).iCheck('update').iCheck('uncheck');
+ $root.find('#recording-input-audio').iCheck('check').attr('checked', true)
-
onMixersChanged: (mixers) ->
this.setState(chatMixer: mixers.chatMixer)
@@ -73,10 +71,10 @@ if accessOpener
recordVideo = NoVideoRecordActive
$root = $(this.getDOMNode())
-
+
if @inputType != 'audio-only'
- console.log('==DEBUG==', this.state.videoEnabled)
- return unless this.state.videoEnabled
+ #return unless this.state.videoEnabled
+ return unless reactContext.JK.videoIsOngoing
# selection = $root.find('#recording-selection').val()
@@ -148,7 +146,7 @@ if accessOpener
@@ -208,6 +206,7 @@ if accessOpener
e.preventDefault()
context.JK.prodBubble($(e.target), 'vid-record-chat-input', {}, {positions:['left']})
+
trackInputType: (e) ->
$checkedType = $(e.target);
@inputType = $checkedType.val()
@@ -255,45 +254,53 @@ if accessOpener
# setTimeout(@resizeWindow, 300)
componentDidMount: `async function() {
- $(window).unload(this.windowUnloaded);
+
+ $(window).unload(this.windowUnloaded);
- const $root = jQuery(this.getDOMNode());
+ const $root = jQuery(this.getDOMNode());
- const $recordingType = $root.find('input[type="radio"]');
- context.JK.checkbox($recordingType);
+ $root.find('#recording-input-audio').iCheck('check')
+ $root.find('#recording-input-both').iCheck().attr('disabled', !reactContext.JK.videoIsOngoing)
- this.inputType = 'audio-only';
- this.audioType = 'audio-only';
+ const $recordingType = $root.find('input[type="radio"]');
+ context.JK.checkbox($recordingType);
- $root.find('input[name="recording-input-type"]').on('ifChanged', this.trackInputType);
- $root.find('input[name="recording-input-chat-option"]').on('ifChanged', this.trackAudioType);
+ this.inputType = 'audio-only';
+ this.audioType = 'audio-only';
- const $recordingRegion = $root.find('#recording-selection');
- //console.log("$recordingou", $recordingRegion)
- //context.JK.dropdown($recordingRegion)
+ $root.find('input[name="recording-input-type"]').on('ifChanged', this.trackInputType);
+ $root.find('input[name="recording-input-chat-option"]').on('ifChanged', this.trackAudioType);
- const $includeChat = $root.find('#include-chat');
- context.JK.checkbox($includeChat);
+ const $recordingRegion = $root.find('#recording-selection');
+ //console.log("$recordingou", $recordingRegion)
+ //context.JK.dropdown($recordingRegion)
- const openWindows = await window.opener.jamClient.getOpenVideoSources();
+ const $includeChat = $root.find('#include-chat');
+ context.JK.checkbox($includeChat);
- console.log("open video sources", openWindows);
+ const openWindows = await window.opener.jamClient.getOpenVideoSources();
- const fixedwindows = [];
- if (openWindows != null) {
- for (let key in openWindows) {
- const value = openWindows[key];
- fixedwindows.push(value);
- }
+ console.log("open video sources", openWindows);
+
+ const fixedwindows = [];
+ if (openWindows != null) {
+ for (let key in openWindows) {
+ const value = openWindows[key];
+ fixedwindows.push(value);
+ }
}
- this.setState({openWindows: fixedwindows});
- this.resizeWindow();
+ this.setState({openWindows: fixedwindows});
+ this.resizeWindow();
- //this is necessary due to whatever the client rendering behavior is.
- return setTimeout(this.resizeWindow, 300);
+ //this is necessary due to whatever the client rendering behavior is.
+ return setTimeout(this.resizeWindow, 300);
}`
+ componentWillUnmount: () ->
+ $root = jQuery(this.getDOMNode());
+ $root.find('#recording-input-both').iCheck('uncheck').attr('disabled', true)
+
componentDidUpdate: () ->
@resizeWindow()