Class VideoControlBuilder
- Namespace
- SharpConsoleUI.Builders
- Assembly
- SharpConsoleUI.dll
Fluent builder for VideoControl.
public sealed class VideoControlBuilder : IControlBuilder<VideoControl>
- Inheritance
-
VideoControlBuilder
- Implements
- Inherited Members
- Extension Methods
Methods
Build()
Builds the VideoControl.
public VideoControl Build()
Returns
Fill()
Fill vertically and stretch horizontally.
public VideoControlBuilder Fill()
Returns
OnPlaybackEnded(EventHandler)
Subscribes to playback ended.
public VideoControlBuilder OnPlaybackEnded(EventHandler handler)
Parameters
handlerEventHandler
Returns
OnPlaybackStateChanged(EventHandler<VideoPlaybackState>)
Subscribes to playback state changes.
public VideoControlBuilder OnPlaybackStateChanged(EventHandler<VideoPlaybackState> handler)
Parameters
handlerEventHandler<VideoPlaybackState>
Returns
Stretch()
Stretch horizontally to fill.
public VideoControlBuilder Stretch()
Returns
WithAlignment(HorizontalAlignment)
Sets horizontal alignment.
public VideoControlBuilder WithAlignment(HorizontalAlignment alignment)
Parameters
alignmentHorizontalAlignment
Returns
WithFile(string)
Sets the video file path. Alias for WithSource(string).
public VideoControlBuilder WithFile(string filePath)
Parameters
filePathstring
Returns
WithLooping(bool)
Enables looping playback.
public VideoControlBuilder WithLooping(bool loop = true)
Parameters
loopbool
Returns
WithMargin(int, int, int, int)
Sets control margin.
public VideoControlBuilder WithMargin(int left, int top, int right, int bottom)
Parameters
Returns
WithName(string)
Sets the control name.
public VideoControlBuilder WithName(string name)
Parameters
namestring
Returns
WithOverlay(bool)
Enables the bottom overlay status bar (auto-show on interaction, auto-hide after 3s).
public VideoControlBuilder WithOverlay(bool enabled = true)
Parameters
enabledbool
Returns
WithRenderMode(VideoRenderMode)
Sets the render mode.
public VideoControlBuilder WithRenderMode(VideoRenderMode mode)
Parameters
modeVideoRenderMode
Returns
WithSource(string)
Sets the video source — file path or URL. Accepts anything FFmpeg understands: local files, HTTP/HTTPS, RTSP, HLS (m3u8), RTMP, FTP, etc.
public VideoControlBuilder WithSource(string source)
Parameters
sourcestring
Returns
WithTargetFps(int)
Sets the target frames per second.
public VideoControlBuilder WithTargetFps(int fps)
Parameters
fpsint
Returns
WithVerticalAlignment(VerticalAlignment)
Sets vertical alignment.
public VideoControlBuilder WithVerticalAlignment(VerticalAlignment alignment)
Parameters
alignmentVerticalAlignment