Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/SharpRTSPClient/RTSPClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging;
using Rtsp;
using Rtsp.Messages;
using Rtsp.Onvif;
Expand Down Expand Up @@ -57,7 +57,7 @@ public class RTSPClient : IDisposable

public bool AutoPlay { get; set; } = true;

private enum RtspStatus { WaitingToConnect, Connecting, ConnectFailed, Connected };
public enum RtspStatus { WaitingToConnect, Connecting, ConnectFailed, Connected };

private IRtspTransport _rtspSocket; // RTSP connection
private RtspStatus _rtspSocketStatus = RtspStatus.WaitingToConnect;
Expand Down Expand Up @@ -353,6 +353,14 @@ public bool StreamingFinished()
}
}

/// <summary>
/// Returns the current RTSP status.
/// </summary>
/// <returns>The current RTSP status.</returns>
public RtspStatus GetRtspStatus()
{
return _rtspSocketStatus;
}
Comment on lines +360 to +363
/// <summary>
/// Pause.
/// </summary>
Expand Down Expand Up @@ -451,6 +459,7 @@ public void Play(DateTime seekTimeFrom, DateTime seekTimeTo, double speed = 1.0)
public void Stop()
{
StopClient();
_rtspSocketStatus = RtspStatus.WaitingToConnect;
}
Comment on lines 459 to 463

private void StopClient()
Expand Down