Class SkinPlayerControls
- Namespace
- VisioForge.Core.UI.WPF.Skins
- Assembly
- VisioForge.Core.dll
A comprehensive WPF control that provides a skinnable media player interface. This control manages player controls, playlist display, video effects, and timeline scrubbing functionality with full skin support.
public class SkinPlayerControls : Grid, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient, IAddChild, IDisposableInheritance
Implements
Inherited Members
Remarks
The SkinPlayerControls class provides a complete media player interface including:
- Play/pause/stop controls with visual state management
- Timeline slider with seeking capabilities
- Volume control with mute functionality
- Playlist integration with item management
- Video effects window integration
- Full-screen mode support
- Settings dialog integration
- Auto-hide functionality for overlay scenarios
The control integrates with the VisioForge skinning system to provide customizable appearances and supports both mouse and keyboard interactions. All UI updates are properly marshalled to the UI thread for thread safety.
Constructors
SkinPlayerControls()
Initializes a new instance of the VisioForge.Core.UI.WPF.Skins.SkinPlayerControls class.
public SkinPlayerControls()Remarks
Sets up the control's timers, event handlers, and UI lifecycle management. The constructor initializes position update and auto-hide timers, and configures the control's loaded/unloaded event handlers for proper resource management.
Fields
SkinNameProperty
The skin name property.
public static readonly DependencyProperty SkinNamePropertyField Value
Properties
Filename
Gets or sets the filename or URL of the media to be played.
public string Filename { get; set; }Property Value
Remarks
This property is used when the play button is clicked to determine what media to load and play. It should be set before attempting to play media.
Player
Gets or sets the media player interface that this control manages.
public IMediaPlayerControls Player { get; set; }Property Value
Remarks
This property establishes the connection between the UI controls and the underlying media player. When set, it enables the player controls to interact with the media playback engine.
SkinName
Gets or sets the name of the skin.
public string SkinName { get; set; }Property Value
Methods
ConnectPlaylist(SkinPlaylist)
Connects a playlist control to enable integrated playlist management.
public void ConnectPlaylist(SkinPlaylist playlist)Parameters
playlistSkinPlaylist-
The playlist control to connect for media queue management.
Remarks
This method establishes the connection between the player controls and the playlist, enabling seamless media queue management and playback integration.
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected virtual void Dispose(bool disposing)Parameters
disposingbool-
trueto release both managed and unmanaged resources;falseto release only unmanaged resources.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()PlayNewFileAsync(string)
Asynchronously loads and plays a new media file.
public Task PlayNewFileAsync(string filename)Parameters
filenamestring-
The filename or URL of the media file to play.
Returns
- Task
-
A Task representing the asynchronous operation that completes when the file is loaded and playback begins.
Remarks
This method stops any currently playing media, loads the specified file, and begins playback. The operation is performed asynchronously to prevent UI blocking during file loading. The UI state is updated to reflect the new playback status upon completion.
OnAction
Occurs when a user action is performed on the player controls.
public event EventHandler<SkinActionEventArgs> OnActionEvent Type
Remarks
This event is raised for various user interactions such as button clicks, allowing the host application to handle or override the default behavior. The event arguments contain information about the specific action performed.
OnPlayClick
Occurs after the play button is clicked and the play operation is completed.
public event EventHandler OnPlayClickEvent Type
Remarks
This event is raised after the media player has started playing and the UI has been updated to reflect the playing state.
OnPreparePlayClick
Occurs when the play button is clicked but before the play operation is performed.
public event EventHandler OnPreparePlayClickEvent Type
Remarks
This event allows the host application to perform any necessary preparation or validation before the media player actually starts playing.
OnPrepareStopClick
Occurs when the stop button is clicked but before the stop operation is performed.
public event EventHandler OnPrepareStopClickEvent Type
Remarks
This event allows the host application to perform any necessary cleanup or confirmation before the media player is actually stopped.
OnStopClick
Occurs after the stop button is clicked and the stop operation is completed.
public event EventHandler OnStopClickEvent Type
Remarks
This event is raised after the media player has been stopped and the UI has been updated to reflect the stopped state.