Class HlsClientSource
Represents an HLS (HTTP Live Streaming) client source that downloads and parses HLS playlists and media segments, implementing IInteractiveMediaSource for interactive playback control and IDiscardable for stream discard support.
public class HlsClientSource : AbstractHttpSource, INetworkSource, INetworkEndPoint, IInteractiveMediaSource, IMediaSource, IReferenceable, IDisposable, IDiscardable
- Inheritance
-
HlsClientSource
- Implements
- Inherited Members
Constructors
HlsClientSource()
Initializes a new instance of the HlsClientSource class.
public HlsClientSource()
Properties
AllowAdaptiveStreamSwitch
Gets or sets whether to apply automatic adaptive stream switching in the source. Makes sense only when IsAdaptiveStreamSwitchSupported returns true.
public bool AllowAdaptiveStreamSwitch { get; set; }
Property Value
AllowEos
Gets or sets whether source will stop on end of stream.
public bool AllowEos { get; set; }
Property Value
Available
Gets whether source actually supports exposed IInteractiveMediaSource for currently opened URI.
public bool Available { get; }
Property Value
CanPause
Gets whether source is capable of pausing
public bool CanPause { get; }
Property Value
CanSeek
Gets whether source is capable of seeking
public bool CanSeek { get; }
Property Value
Capabilities
Gets the list of source capabilities
public override List<SourceCapability> Capabilities { get; }
Property Value
DiscardMode
Gets or sets the discard mode that controls how streams are filtered for output. Can only be changed before the source is started.
public DiscardMode DiscardMode { get; set; }
Property Value
DiscardState
Gets current discard state of all original streams. The number of elements is equal to OriginalStreamCount. Can return empty list if source is not opened yet, is stopped or errored.
public List<bool> DiscardState { get; }
Property Value
Duration
Gets source duration if applicable, otherwise 0
public TimeSpan Duration { get; }
Property Value
IsAdaptiveStreamSwitchSupported
Gets whether adaptive stream switching supported by the source.
public bool IsAdaptiveStreamSwitchSupported { get; }
Property Value
IsChangeable
Gets whether source is changeable, i.e. duration will change in time
public bool IsChangeable { get; }
Property Value
IsMonitor
Gets or sets whether source is monitoring file changes
public bool IsMonitor { get; set; }
Property Value
Loop
Gets or sets whether playback should be an endless loop. If value is true then seek and pause are not available.
public bool Loop { get; set; }
Property Value
OriginalStreamCount
Gets the total number of original streams before discard filtering is applied.
public int OriginalStreamCount { get; }
Property Value
Parameters
Gets or sets source parameters
public override SourceParameters Parameters { get; set; }
Property Value
PlaybackRate
Gets or sets playback rate (if applicable). If value is 1 then normal playback pace is maintained. If value is more than 1 then it means fast forward playback with possible I-frames only stream if supported by source. If value is in (0..1) range then it means slow motion playback. If value is less or equal to -1 then it means rewind playback with possible I-frames only stream if supported by source. If value is double.MaxValue then source pushes samples as quickly as possible, without considering sample timestamps and playback time.
public double PlaybackRate { get; set; }
Property Value
Position
Gets or sets source playback position if seek is supported
public TimeSpan Position { get; set; }
Property Value
StreamCount
Gets the number of output streams currently available.
public override int StreamCount { get; }
Property Value
Methods
Discard(Dictionary<int, bool>)
Applies discard flags for selected streams. This is a smooth discard request which should not produce any interruptions in playback.
public void Discard(Dictionary<int, bool> values)
Parameters
valuesDictionary<int, bool>Map of stream index to discard value
GetMediaType(int)
Gets the media type of the specified output stream.
public override MediaType GetMediaType(int streamIndex)
Parameters
streamIndexintThe zero-based output stream index to get the media type for.
Returns
GetMediaTypeAndIndices(int)
Gets media type of the specified stream and all indices
public NewStreamEventArgs GetMediaTypeAndIndices(int streamIndex)
Parameters
streamIndexintStream index to get media type for
Returns
- NewStreamEventArgs
Media type and all indices of requested stream
GetOriginalMediaType(int)
Gets media type of the specified original stream
public MediaType GetOriginalMediaType(int streamIndex)
Parameters
streamIndexintOriginal stream index to get media type for
Returns
- MediaType
Media type of requested stream
Pause()
Pauses pushing of media data
public void Pause()
QueueRequiredAction(ActionRequiredEventArgs)
Queues required action for further processing
public void QueueRequiredAction(ActionRequiredEventArgs e)
Parameters
eActionRequiredEventArgsRequired action
SetDesiredOutputType(int, MediaType)
Sets the desired output type for the specified stream. Not supported by this source.
public override Task SetDesiredOutputType(int streamIndex, MediaType mediaType)
Parameters
Returns
- Task
This method always throws NotImplementedException.
Start()
Starts or resumes playback of the source. For VOD and event sources that are already started, this queues a play action instead of restarting.
public override void Start()
Events
SourceChanged
Source has changed, i.e. duration and frame tables have to be updated. Not applicable for current source.
public event EventHandler SourceChanged