pause before change to js
This commit is contained in:
parent
cb24078c19
commit
d573904d05
|
|
@ -27,8 +27,6 @@
|
|||
"error" : 1
|
||||
}
|
||||
|
||||
var logCache = [];
|
||||
|
||||
if ('undefined' === typeof(context.console)) {
|
||||
context.console = {};
|
||||
$.each(console_methods, function(index, value) {
|
||||
|
|
@ -62,11 +60,6 @@
|
|||
logAsString.push("unable to parse node: " + e.toString());
|
||||
}
|
||||
}
|
||||
logCache.push([method].concat(logAsString));
|
||||
if(logCache.length > 50) {
|
||||
// keep the cache size 50 or lower
|
||||
logCache.shift();
|
||||
}
|
||||
|
||||
if (original.apply){
|
||||
// Do this for normal browsers
|
||||
|
|
@ -92,7 +85,6 @@
|
|||
takeOverConsole();
|
||||
|
||||
context.JK.logger = context.console;
|
||||
context.JK.logger.logCache = logCache;
|
||||
|
||||
|
||||
})(window, jQuery);
|
||||
|
|
@ -1049,7 +1049,7 @@
|
|||
};
|
||||
|
||||
server.onMessage = function (e) {
|
||||
console.log("__ONMESSAGE__", JSON.parse(e.data));
|
||||
//console.log("__ONMESSAGE__", JSON.parse(e.data));
|
||||
var message = JSON.parse(e.data),
|
||||
messageType = message.type.toLowerCase(),
|
||||
payload = message[messageType],
|
||||
|
|
@ -1057,7 +1057,18 @@
|
|||
|
||||
if (message.type == context.JK.MessageType.PEER_MESSAGE) {
|
||||
//logger.info("server.onMessage:" + messageType);
|
||||
} else if (
|
||||
// route_to | from | peer_message
|
||||
try {
|
||||
console.log(`P2P ${message.from} > ${message.route_to} msg:${atob(atob(message.peer_message.message))}`)
|
||||
}
|
||||
catch(e) {
|
||||
console.log("P2P INVALID", JSON.parse(e.data));
|
||||
}
|
||||
}
|
||||
else if (message.type == context.JK.MessageType.TRACKS_CHANGED) {
|
||||
console.log(`TRACKS_CHANGED counter:${message.tracks_changed.track_changes_counter}`)
|
||||
}
|
||||
else if (
|
||||
message.type != context.JK.MessageType.HEARTBEAT_ACK &&
|
||||
message.type != context.JK.MessageType.PEER_MESSAGE
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -1444,7 +1444,6 @@
|
|||
var recordingId = options["id"];
|
||||
|
||||
console.log("getRecording: ", options)
|
||||
console.trace()
|
||||
|
||||
return $.ajax({
|
||||
type: "GET",
|
||||
|
|
@ -1457,7 +1456,6 @@
|
|||
function getRecordingPromise(options) {
|
||||
return new Promise(function(resolve, reject){
|
||||
console.log("getRecordingPromise: ", options)
|
||||
console.trace()
|
||||
|
||||
var recordingId = options["id"];
|
||||
$.ajax({
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ profileUtils = context.JK.ProfileUtils
|
|||
@root = $(@getDOMNode())
|
||||
|
||||
componentDidUpdate: () ->
|
||||
datePicked = @datePicked.bind(this)
|
||||
datePicked = @datePicked
|
||||
@sessionDate = @root.find('.date-picker')
|
||||
@sessionDate.each(() ->
|
||||
$this = $(this)
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ SessionStore = @SessionStore
|
|||
activeChannel = @state.channel
|
||||
|
||||
if activeChannel == 'global'
|
||||
openBig = `<a className="make-big" href="#" onClick={this.openChatDialog.bind(this)}>Expand</a>`
|
||||
openBig = `<a className="make-big" href="#" onClick={this.openChatDialog}>Expand</a>`
|
||||
|
||||
activeMsgs = @state.msgs[activeChannel] || []
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ ConfigureTracksActions = @ConfigureTracksActions
|
|||
if path.type == "VST"
|
||||
for vstPath in path.paths
|
||||
|
||||
paths.push(`<tr><td className="manage-vst-path"><div>{vstPath}</div></td><td className="manage-vst-action"><div><a onClick={this.deletePath.bind(this, vstPath)}>delete</a></div></td></tr>`)
|
||||
paths.push(`<tr key={vstPath}><td className="manage-vst-path"><div>{vstPath}</div></td><td className="manage-vst-action"><div><a onClick={this.deletePath.bind(this, vstPath)}>delete</a></div></td></tr>`)
|
||||
|
||||
contents = `<div>
|
||||
<table className="generaltable manage-vst-table">
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ RecordingActions = @RecordingActions
|
|||
this.props.app.layout.showDialog('chat-dialog', {d1: 'session_' + this.props.sessionId})
|
||||
|
||||
render: () ->
|
||||
`<a className="session-record button-grey left" onClick={this.openChat.bind(this)}>
|
||||
`<a className="session-record button-grey left" onClick={this.openChat}>
|
||||
<img src="/assets/content/icon_open_folder.png" align="texttop" height="14" width="14"/>
|
||||
FILES
|
||||
</a>`
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ AppStore = context.AppStore
|
|||
onAppInit: (@app) ->
|
||||
|
||||
onSessionMixerChange: (sessionMixers) ->
|
||||
console.log("_DEBUG_* SessionRecordBtn onSessionMixerChange", sessionMixers.session)
|
||||
#console.log("_DEBUG_* SessionRecordBtn onSessionMixerChange", sessionMixers.session)
|
||||
@setState({isRecording: sessionMixers.session.isRecording})
|
||||
@setState({isRecordingOwner: sessionMixers.session.recordingOwnerId && sessionMixers.session.recordingOwnerId == @app.currentUserId})
|
||||
|
||||
|
|
|
|||
|
|
@ -185,12 +185,12 @@ mixins.push(Reflux.listenTo(RecordingStore, "onRecordingStateChanged"))
|
|||
|
||||
for format, i in context.JK.AUDIO_FORMATS
|
||||
if format == @state.audioFormat
|
||||
audioFormatOptions.push `<option value={format} selected>{format}</option>`
|
||||
audioFormatOptions.push `<option key={format} value={format}>{format}</option>`
|
||||
else
|
||||
audioFormatOptions.push `<option value={format}>{format}</option>`
|
||||
audioFormatOptions.push `<option key={format} value={format}>{format}</option>`
|
||||
|
||||
for format, i in context.JK.VIDEO_FORMATS
|
||||
videoFormatOptions.push `<option value={format}>{format}</option>`
|
||||
videoFormatOptions.push `<option key={format} value={format}>{format}</option>`
|
||||
|
||||
startRecordingClasses = classNames({"button-orange": true, disabled: this.state.startRequested})
|
||||
|
||||
|
|
@ -217,7 +217,7 @@ mixins.push(Reflux.listenTo(RecordingStore, "onRecordingStateChanged"))
|
|||
<div className="form-item">
|
||||
<label htmlFor="audio-format">Audio Format:</label>
|
||||
<div>
|
||||
<select id="audio-format" value={this.state.audioFormat} onChange={this.setAudioFormatChange}>
|
||||
<select id="audio-format" value={this.state.audioFormat} onChange={this.setAudioFormatChange} defaultValue={this.state.audioFormat}>
|
||||
{audioFormatOptions}
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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 = `<span className="recording-on">Recording</span>`
|
||||
else
|
||||
recording = `<span className="recording-off">Not Recording</span>`
|
||||
|
||||
cause = `<span className="cause">cause={this.state.cause}</span>`
|
||||
|
||||
console.log("modelState ", modelState, modelState?.waitingOnClientStop, modelState?.waitingOnServerStop)
|
||||
|
||||
waitingOnClientStop = null
|
||||
waitingOnServerStop = null
|
||||
if modelState?
|
||||
if modelState.waitingOnClientStop
|
||||
waitingOnClientStop = `<span className="cause">clientStopping</span>`
|
||||
if modelState.waitingOnServerStop
|
||||
waitingOnServerStop = `<span className="cause">serverStopping</span>`
|
||||
|
||||
events = []
|
||||
for event in @state.events
|
||||
events.push(`<li key={event[0]}>{event[0]}</li>`)
|
||||
body = `<div className="msg">{recording} {cause} {waitingOnClientStop} {waitingOnServerStop}</div>`
|
||||
|
||||
`<div className={classes}>
|
||||
{body}
|
||||
<ul className="recording-events">
|
||||
{events}
|
||||
</ul>
|
||||
</div>`
|
||||
|
||||
componentDidMount: () ->
|
||||
|
||||
})
|
||||
|
|
@ -38,6 +38,7 @@ SessionActions = @SessionActions
|
|||
<SessionOtherTracks mode={MIX_MODES.PERSONAL} />
|
||||
<SessionMediaTracks mode={MIX_MODES.PERSONAL} />
|
||||
<SessionNotifications />
|
||||
<SessionRecordingStatus />
|
||||
</div>
|
||||
</div>`
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ context = window
|
|||
stoppingRecording: {}
|
||||
stoppedRecording: {}
|
||||
abortedRecording: {}
|
||||
resetRecordingState: {}
|
||||
openRecordingControls: {}
|
||||
recordingControlsClosed: {}
|
||||
mixTransferred: {}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 = {}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}`
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue