Skip to content

Commit

Permalink
Merge pull request #17 from Panopto/afein/m/disable-preview-fix
Browse files Browse the repository at this point in the history
This fixes a customer reported bug where the light service can't be used to start a recording if the remote recorder has DisablePreview set to True.
  • Loading branch information
andifein authored Feb 23, 2018
2 parents fb09427 + e19279d commit c110b6d
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 25 deletions.
6 changes: 4 additions & 2 deletions PanoptoRRLightService/IStateMachine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public enum State
Paused,
TransitionPausedToStop,
TransitionRecordingToStop,
Stopped,
StoppedNoNextSchedule,
StoppedWithNextSchedule,
Dormant,
Faulted,
Disconnected,
Expand All @@ -59,7 +60,8 @@ public enum Input
RecorderRecording,
RecorderStartedPotentialRecording,
RecorderPaused,
RecorderStopped,
RecorderStoppedNoNextSchedule,
RecorderStoppedWithNextSchedule,

/// <summary>
/// Recorder may be in a state that is running, but not recording or previewing.
Expand Down
13 changes: 11 additions & 2 deletions PanoptoRRLightService/RemoteRecorderSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,19 @@ private void StateMonitorLoop()
/// </summary>
private Input MapInputFrom(RemoteRecorderStatus state)
{
Recording nextRecording;
switch (state)
{
case RemoteRecorderStatus.Stopped:
return Input.RecorderStopped;
nextRecording = controller.GetNextRecording();
if (nextRecording != null)
{
return Input.RecorderStoppedWithNextSchedule;
}
else
{
return Input.RecorderStoppedNoNextSchedule;
}

case RemoteRecorderStatus.Recording:
if (Properties.Settings.Default.RequireOptInForRecording)
Expand All @@ -492,7 +501,7 @@ private Input MapInputFrom(RemoteRecorderStatus state)
return Input.RecorderDormant;

case RemoteRecorderStatus.Previewing:
Recording nextRecording = controller.GetNextRecording();
nextRecording = controller.GetNextRecording();
if (nextRecording != null)
{
return Input.RecorderPreviewingWithNextSchedule;
Expand Down
Loading

0 comments on commit c110b6d

Please sign in to comment.