-
@@ -342,7 +342,6 @@ mixins.push(Reflux.listenTo(RecordingStore, "onRecordingStateChanged"))
//get the audio store type from backend and set the radio button accordingly using jamClient.GetAudioRecordingPreference()
context.jamClient.GetAudioRecordingPreference().then((audioStoreType) => {
- console.log('_REC_ componentDidMount audioStoreType', audioStoreType);
this.updateAudioStoreState(audioStoreType);
});
@@ -393,9 +392,8 @@ mixins.push(Reflux.listenTo(RecordingStore, "onRecordingStateChanged"))
# #$root.find('#audio-store-types').unbind('change').change(this.setAudioStoreTypeChange)
componentDidUpdate: `function () {
- console.log('componentDidUpdate');
context.jamClient.GetAudioRecordingPreference().then((audioStoreType) => {
- console.log('_REC_ componentDidUpdate audioStoreType', audioStoreType);
+ //console.log('_REC_ componentDidUpdate audioStoreType', audioStoreType);
this.updateAudioStoreState(audioStoreType);
});
const $root = $(this.getDOMNode());
diff --git a/web/app/assets/javascripts/react-components/SessionRecordingStatus.js.jsx.coffee b/web/app/assets/javascripts/react-components/SessionRecordingStatus.js.jsx.coffee
new file mode 100644
index 000000000..09d2bc862
--- /dev/null
+++ b/web/app/assets/javascripts/react-components/SessionRecordingStatus.js.jsx.coffee
@@ -0,0 +1,59 @@
+context = window
+RecordingStore = @RecordingStore
+@SessionRecordingStatus = React.createClass({
+ mixins: [Reflux.listenTo(@RecordingStore, "onRecordingChanged")]
+
+ onRecordingChanged: (details) ->
+ console.log("SessionRecordingStatus RECORDING CHANGED ", details)
+
+ @setState(details)
+
+ getInitialState: () ->
+ {
+ isRecording: false,
+ cause: "",
+ events:[]
+ }
+
+ render: () ->
+
+ classes = classNames({
+ 'session-recording-status' : true
+ 'has-details' : @state.detail?
+ })
+
+ modelState = RecordingStore.recordingModel?.getState()
+ #if @state.isRecording == false
+ # return null
+ if this.state.isRecording
+ recording = `
Recording`
+ else
+ recording = `
Not Recording`
+
+ cause = `
cause={this.state.cause}`
+
+ console.log("modelState ", modelState, modelState?.waitingOnClientStop, modelState?.waitingOnServerStop)
+
+ waitingOnClientStop = null
+ waitingOnServerStop = null
+ if modelState?
+ if modelState.waitingOnClientStop
+ waitingOnClientStop = `
clientStopping`
+ if modelState.waitingOnServerStop
+ waitingOnServerStop = `
serverStopping`
+
+ events = []
+ for event in @state.events
+ events.push(`
{event[0]}`)
+ body = `
{recording} {cause} {waitingOnClientStop} {waitingOnServerStop}
`
+
+ `
`
+
+ componentDidMount: () ->
+
+})
\ No newline at end of file
diff --git a/web/app/assets/javascripts/react-components/SessionScreen.js.jsx.coffee b/web/app/assets/javascripts/react-components/SessionScreen.js.jsx.coffee
index 207d5379b..e16627daf 100644
--- a/web/app/assets/javascripts/react-components/SessionScreen.js.jsx.coffee
+++ b/web/app/assets/javascripts/react-components/SessionScreen.js.jsx.coffee
@@ -38,6 +38,7 @@ SessionActions = @SessionActions
+
`
diff --git a/web/app/assets/javascripts/react-components/actions/RecordingActions.js.coffee b/web/app/assets/javascripts/react-components/actions/RecordingActions.js.coffee
index d6a22cdc0..20167d313 100644
--- a/web/app/assets/javascripts/react-components/actions/RecordingActions.js.coffee
+++ b/web/app/assets/javascripts/react-components/actions/RecordingActions.js.coffee
@@ -9,6 +9,7 @@ context = window
stoppingRecording: {}
stoppedRecording: {}
abortedRecording: {}
+ resetRecordingState: {}
openRecordingControls: {}
recordingControlsClosed: {}
mixTransferred: {}
diff --git a/web/app/assets/javascripts/react-components/helpers/MixerHelper.js.coffee b/web/app/assets/javascripts/react-components/helpers/MixerHelper.js.coffee
index fae8035ef..c8d4f848c 100644
--- a/web/app/assets/javascripts/react-components/helpers/MixerHelper.js.coffee
+++ b/web/app/assets/javascripts/react-components/helpers/MixerHelper.js.coffee
@@ -155,8 +155,11 @@ MIX_MODES = context.JK.MIX_MODES;
# mediaType == null is for backwards compat with older clients. Can be removed soon
@recordingTrackMixers.push(mixer)
else
- logger.warn("Unknown track type: " + mediaType)
- @adhocTrackMixers.push(mixer)
+ # we receive Broadcast mixers; this is expected, but we deliberately do not have
+ # UI implemented yet for them
+ if mediaType != 'Broadcast'
+ logger.warn("Unknown track type: " + mediaType)
+ @adhocTrackMixers.push(mixer)
groupByType(localMediaMixers, true);
groupByType(peerLocalMediaMixers, false);
diff --git a/web/app/assets/javascripts/react-components/stores/BroadcastStore.js.coffee b/web/app/assets/javascripts/react-components/stores/BroadcastStore.js.coffee
index 359797d72..ba38d57c5 100644
--- a/web/app/assets/javascripts/react-components/stores/BroadcastStore.js.coffee
+++ b/web/app/assets/javascripts/react-components/stores/BroadcastStore.js.coffee
@@ -154,7 +154,6 @@ BroadcastStore = Reflux.createStore(
if @subscriptionRules
if !@subscriptionRules.remaining_month_until? && !@sessionRules.remaining_session_until?
- console.log("no license issues")
@subscriptionConcern = null
else
@subscriptionConcern = {}
diff --git a/web/app/assets/javascripts/react-components/stores/MixerStore.js.coffee b/web/app/assets/javascripts/react-components/stores/MixerStore.js.coffee
index 389d8e82a..f91658ff4 100644
--- a/web/app/assets/javascripts/react-components/stores/MixerStore.js.coffee
+++ b/web/app/assets/javascripts/react-components/stores/MixerStore.js.coffee
@@ -106,8 +106,9 @@ rest = context.JK.Rest()
# GetControlState for this mixer which returns min/max
# value is a DB value from -80 to 20. Convert to float from 0.0-1.0
#console.log('handleBridgeCallback@mixers',@mixers)
-
- @mixers.updateVU(mixerId, mode, (leftValue + 80) / 80, leftClipping, (rightValue + 80) / 80, rightClipping)
+
+ if @mixers?
+ @mixers.updateVU(mixerId, mode, (leftValue + 80) / 80, leftClipping, (rightValue + 80) / 80, rightClipping)
#@mixers.updateVU(mixerId + "_vur", (rightValue + 80) / 80, rightClipping)
@@ -162,7 +163,6 @@ rest = context.JK.Rest()
this.personalMixers = await context.jamClient.SessionGetAllControlState(false);
this.mixers = new context.MixerHelper(this.session, this.masterMixers, this.personalMixers, this.metro, this.noAudioUsers, this.clientsWithAudioOverride, (this.mixers != null ? this.mixers.mixMode : undefined) || MIX_MODES.PERSONAL);
- console.log(this.mixers)
return this.issueChange();
}`
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 a1d5c8543..78f96a732 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
@@ -16,6 +16,7 @@ BackendToFrontendFPS = {
listenables: @RecordingActions
#recordingWindow: null
recordingWindowOpened: false
+ events: []
init: ->
# Register with the app store to get @app
@@ -31,9 +32,9 @@ BackendToFrontendFPS = {
$(context.AppStore).on('SessionEnded', @onSessionEnded)
onInitModel: (recordingModel) ->
- console.log("_DEBUG_ RecordingStore.onInitModel", JSON.stringify(recordingModel) )
@recordingModel = recordingModel
- this.trigger({isRecording: @recordingModel.isRecording()})
+ @events=[]
+ this.trigger({isRecording: @recordingModel.isRecording(), events:@events})
# onStartRecording: (recordVideo, recordChat) ->
# frameRate = 0
@@ -48,21 +49,47 @@ BackendToFrontendFPS = {
# logger.debug("onStartRecording: recordVideo: #{recordVideo}, recordChat: #{recordChat} frameRate: #{frameRate}")
# @recordingModel.startRecording(recordVideo, recordChat, frameRate)
+ onResetRecordingState: () ->
+ console.log("onResetRecordingState")
+ this.trigger({isRecording: @recordingModel.isRecording(), cause: '', events:@events})
+
onStartRecording: (recordSettings) ->
@recordingModel.startRecording(recordSettings);
+ @events=[]
+ @events.push(["StartRecording"]);
+ augmentWithBackendRecordingId(@events)
+
+ this.trigger(events:@events)
onStopRecording: () ->
@recordingModel.stopRecording()
+ @events.push(["StopRecording"]);
+ augmentWithBackendRecordingId(@events)
+
+ this.trigger(events:@events)
onStartingRecording: (details) ->
details.cause = 'starting'
@mixTransferred = false
+ @events.push(["OnStartingRecording"])
+
+ augmentWithBackendRecordingId(@events)
+
+ details.events = @events
this.trigger(details)
@popupRecordingControls() unless @recordingWindowOpened
+ augmentWithBackendRecordingId(events)
+ # REMOVE ME
+ backendRecordingId = await context.jamClient.GetCurrentRecordingId();
+ event.at(-1).push(backendRecordindId)
+
onStartedRecording: (details) ->
details.cause = 'started'
@mixTransferred = false
+ @events.push(["OnStartedRecording"])
+ details.events = @events
+ augmentWithBackendRecordingId(details)
this.trigger(details)
#@popupRecordingControls() unless @recordingWindowOpened
@@ -70,19 +97,35 @@ BackendToFrontendFPS = {
onStoppingRecording: (details) ->
details.cause = 'stopping'
+ @events.push(["OnStoppingRecording"])
+ details.events = @events
+
+ augmentWithBackendRecordingId(@events)
+
this.trigger(details)
onStoppedRecording: (details) ->
details.cause = 'stopped'
+ @events.push(["OnStoppedRecording"])
+ details.events = @events
+
+ augmentWithBackendRecordingId(@events)
+
+
if @recordingWindowOpened
#@recordingWindow.close()
@closeRecordingWindow()
- this.trigger(details)
+ this.trigger(details, backendRecordingId: backendRecordingId)
onAbortedRecording: (details) ->
details.cause = 'aborted'
+ @events.push(["OnAbortedRecording"])
+ details.events = @events
+
+ augmentWithBackendRecordingId(@events)
+
if @recordingWindowOpened
#@recordingWindow.close()
diff --git a/web/app/assets/javascripts/recordingModel.js b/web/app/assets/javascripts/recordingModel.js
index 8fd3189ba..e865300cf 100644
--- a/web/app/assets/javascripts/recordingModel.js
+++ b/web/app/assets/javascripts/recordingModel.js
@@ -34,6 +34,14 @@
var sessionId = null;
var $self = $(this);
+ function getState() {
+ return {
+ waitingOnClientStop: waitingOnClientStop,
+ waitingOnServerStop: waitingOnServerStop,
+ stoppingRecording: stoppingRecording,
+ startingRecording: startingRecording
+ }
+ }
function isRecording (recordingId) {
// if you specify recordingId, the check is more exact
if(recordingId) {
@@ -47,6 +55,7 @@
/** called every time a session is joined, to ensure clean state */
function reset(_sessionId) {
+ console.log("[RecordingState]: reset")
currentlyRecording = false;
waitingOnServerStop = false;
waitingOnClientStop = false;
@@ -58,6 +67,7 @@
currentRecordingId = null;
stoppingRecording = false;
sessionId = _sessionId
+ context.RecordingActions.resetRecordingState()
}
@@ -117,11 +127,18 @@
/** Nulls can be passed for all 3 currently; that's a user request. */
async function stopRecording(recordingId, reason, detail) {
- const recording = await currentRecording
- if(recording.owner.id !== context.JK.currentUserId){
- return;
- }
+ const userInitiated = recordingId == null && reason == null && detail == null
+ const recording = await currentRecording
+
+ //if(recording.owner.id !== context.JK.currentUserId){
+ // return;
+ //}
+
+ const isRecordingOwner = recording.owner.id == context.JK.currentUserId;
+
+ console.log(`[RecordingState]: stopRecording userInitiated=${userInitiated} isRecordingOwner=${isRecordingOwner} reason=${reason} detail=${detail}`)
+
if(stoppingRecording) {
logger.debug("ignoring stopRecording because we are already stopping");
return;
@@ -148,28 +165,34 @@
//await jamClient.StopRecording(recording.id, groupedTracks);
await jamClient.FrontStopRecording(recording.id, groupedTracks);
-
- rest.stopRecording( { "id": recording.id } )
- .done(function() {
- waitingOnServerStop = false;
- attemptTransitionToStop(recording.id, reason, detail);
- stoppingRecording = false
- })
- .fail(function(jqXHR) {
- stoppingRecording = false
- if(jqXHR.status == 422) {
+
+ if(isRecordingOwner) {
+ rest.stopRecording({"id": recording.id})
+ .done(function () {
waitingOnServerStop = false;
attemptTransitionToStop(recording.id, reason, detail);
- }
- else {
- logger.error("unable to stop recording %o", arguments);
- transitionToStopped();
- var details = {'recordingId': recording.id, 'reason' : 'rest', 'details' : arguments, isRecording: false}
- $self.triggerHandler('stoppedRecording', details);
- context.RecordingActions.stoppedRecording(details)
stoppingRecording = false
- }
- });
+ })
+ .fail(function (jqXHR) {
+ stoppingRecording = false
+ if (jqXHR.status == 422) {
+ waitingOnServerStop = false;
+ attemptTransitionToStop(recording.id, reason, detail);
+ } else {
+ logger.error("unable to stop recording %o", arguments);
+ transitionToStopped();
+ var details = {
+ 'recordingId': recording.id,
+ 'reason': 'rest',
+ 'details': arguments,
+ isRecording: false
+ }
+ $self.triggerHandler('stoppedRecording', details);
+ context.RecordingActions.stoppedRecording(details)
+ stoppingRecording = false
+ }
+ });
+ }
});
return true;
}
@@ -197,6 +220,7 @@
}
function transitionToStopped() {
+ console.log("[RecordingState] transitionToStopped")
currentlyRecording = false;
currentRecording = null;
currentRecordingId = null;
@@ -217,7 +241,7 @@
}
function onServerStopRecording(recordingId) {
- console.log("recordModel.js: onServerStopRecording")
+ console.log("[RecordingState] onServerStopRecording")
var session = context.SessionStore.getCurrentOrLastSession();
if (!session) {
@@ -264,7 +288,7 @@
}
function handleRecordingStopResult(recordingId, result) {
- console.log("[RecordingState] handleRecordingStopResult")
+ console.log("[RecordingState] handleRecordingStopResult", result)
var success = result.success;
var reason = result.reason;
var detail = result.detail;
@@ -476,54 +500,39 @@
* sync recording state with the client back end
*/
async function getCurrentRecordingState() {
- console.log("[RecordingState] Getting current recording state", {
- sessionId,
- currentUserId: context.JK.currentUserId,
- currentRecordingId,
- currentlyRecording
- });
-
var recording = null;
var session = context.SessionStore.getCurrentOrLastSession();
- if (!session) {
- logger.debug("no session, so no recording");
- return { isRecording: false, recordingOwnerId: null };
- }
+
var recordingId = await context.jamClient.GetCurrentRecordingId();
- console.log("[RecordingState] Local client recording state", {
- recordingId,
- sessionId: session.id,
- currentUserId: context.JK.currentUserId
- });
-
+
var isRecording = recordingId && recordingId != "";
- if (isRecording) {
+
+ if (session && isRecording) {
try {
- console.log("[RecordingState] Attempting to fetch server recording state", {
- recordingId,
- sessionId: session.id
- });
recording = await rest.getRecordingPromise({ id: recordingId })
- console.log("[RecordingState] Server recording state", {
- recordingId,
- ownerId: recording?.owner?.id,
- currentUserId: context.JK.currentUserId,
- recordingState: recording
- });
} catch (error) {
- console.error("[RecordingState] Failed to fetch server recording state", {
- recordingId,
- error,
- errorMessage: error.message,
- errorStatus: error.status,
- errorResponse: error.responseJSON,
- sessionId: session.id,
- currentUserId: context.JK.currentUserId
- });
+ if(error.status != 404) {
+ console.error("[RecordingState] Failed to fetch server recording state", {
+ recordingId,
+ error,
+ errorMessage: error.message,
+ errorStatus: error.status,
+ errorResponse: error.responseJSON,
+ sessionId: session.id,
+ currentUserId: context.JK.currentUserId
+ });
+ }
}
}
+
+ if (!session) {
+ console.debug("no session, so no recording");
+ return { isRecording: false, serverRecording: null, recordingOwnerId: null };
+ }
+
return {
isRecording: isRecording,
+ isServerRecording: !!recording,
recordingOwnerId: isRecording && recording ? recording.owner.id : null,
}
}
@@ -539,6 +548,7 @@
this.isRecording = isRecording;
this.reset = reset;
this.stopRecordingIfNeeded = stopRecordingIfNeeded;
+ this.getState = getState;
this.currentOrLastRecordingId = function () { return currentOrLastRecordingId; };
this.getCurrentRecordingState = getCurrentRecordingState;
diff --git a/web/app/assets/javascripts/session.js b/web/app/assets/javascripts/session.js
index 62aabda9c..d30f50f3e 100644
--- a/web/app/assets/javascripts/session.js
+++ b/web/app/assets/javascripts/session.js
@@ -1133,7 +1133,6 @@
// mediaType == null is for backwards compat with older clients. Can be removed soon
recordingTrackMixers.push(mixer)
} else {
- logger.warn("Unknown track type: " + mediaType)
adhocTrackMixers.push(mixer);
}
});
diff --git a/web/app/assets/stylesheets/client/react-components/SessionScreen.scss b/web/app/assets/stylesheets/client/react-components/SessionScreen.scss
index e09156055..d9ee1f140 100644
--- a/web/app/assets/stylesheets/client/react-components/SessionScreen.scss
+++ b/web/app/assets/stylesheets/client/react-components/SessionScreen.scss
@@ -433,6 +433,33 @@ $session-screen-divider: 1190px;
.session-mytracks-notracks p.notice {
font-size: 14px;
}
+
+ .session-recording-status {
+ position:absolute;
+ width:500px;
+ bottom:0;
+ left:3px;
+ max-height: 100%; /* Prevents growing outside the container */
+ font-family:monospace;
+
+ .recording-on {
+ font-weight:bold;
+ color:green;
+ }
+ .recording-off {
+ font-weight:bold;
+ color:red;
+ }
+ .cause {
+ font-weight:bold;
+ }
+ ul.recording-events {
+ li {
+ margin-bottom: 1px;
+ margin-top: 1px;
+ }
+ }
+ }
.session-notification {
color: white;
background-color: #666666;