Class SkinPlayerControls
- Namespace
- VisioForge.Core.UI.MAUI.Skins
- Assembly
- VisioForge.Core.UI.MAUI.dll
A comprehensive MAUI control that provides a skinnable media player interface. This control manages player controls, timeline scrubbing, volume control, and auto-hide functionality with full skin support across all MAUI platforms.
public class SkinPlayerControls : Grid, INotifyPropertyChanged, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IViewController, IVisualElementController, IElementController, IGestureController, IGestureRecognizers, IPropertyMapperView, IHotReloadableView, IReplaceableView, IBindableLayout, IVisualTreeElement, IGridLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout, IDisposableInheritance
Implements
Inherited Members
Remarks
The SkinPlayerControls provides:
- Play/pause controls with visual state management
- Timeline slider with seeking capabilities
- Volume control with mute functionality
- Next/Previous frame navigation
- Speed control (0.5x, 1x, 2x playback speeds)
- Auto-hide functionality for overlay scenarios
- Settings and file open dialogs
Platform support:
- Windows: Full pointer interaction with auto-hide
- Android: Touch interaction with auto-hide
- iOS/macCatalyst: Tap gesture recognition with auto-hide
The control integrates with the VisioForge skinning system to provide customizable appearances and supports IMediaPlayerControls interface for player integration.
Constructors
SkinPlayerControls()
Initializes a new instance of the VisioForge.Core.UI.MAUI.Skins.SkinPlayerControls class.
public SkinPlayerControls()Fields
SkinNameProperty
The element type property.
public static readonly BindableProperty SkinNamePropertyField Value
Properties
Filename
Gets or sets the full path to the media file to be played.
public string Filename { get; set; }Property Value
Remarks
This property is automatically set when the user selects a file using the Open File button. You can also set it programmatically to load a specific media file.
When the play button is clicked and the player is in the Free state, the file specified by this property will be opened and played automatically.
Supported formats depend on the configured media player engine (GStreamer, DirectShow, etc.).
Player
Gets or sets the media player instance that this control will manage.
public IMediaPlayerControls Player { get; set; }Property Value
- IMediaPlayerControls
Remarks
When setting this property:
- The previous player's OnStart event is unsubscribed
- The new player's OnStart event is subscribed for duration updates
- The control gains access to playback controls (play, pause, seek, volume, etc.)
The control interacts with the player through the IMediaPlayerControls interface, providing a unified interface for both MediaPlayerCoreX and MediaPlayerCore implementations.
Setting this property to null detaches the player and disables control functionality.
SkinName
Gets or sets the name of the skin to apply to the player controls.
public string SkinName { get; set; }Property Value
Remarks
When this property is set, the control loads the specified skin from the SkinManager and updates all visual elements (buttons, sliders, text colors, background) to match the skin's styling.
The skin must be loaded into the SkinManager before setting this property. Use VisioForge.Core.UI.Skins.SkinManager.LoadFromFile(System.String) or VisioForge.Core.UI.Skins.SkinManager.LoadFromData(System.String,System.Byte[]) to load skins.
Changing the skin dynamically updates the UI immediately.
Methods
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()
Releases all resources used by the VisioForge.Core.UI.MAUI.Skins.SkinPlayerControls.
public void Dispose()Remarks
This method performs comprehensive cleanup:
- Unsubscribes from all platform-specific event handlers (Windows pointer, Android touch, iOS gestures)
- Disposes and stops both timers (position update and auto-hide)
- Unsubscribes from player events
- Cancels iOS/macCatalyst tap delay operations
- Removes iOS gesture recognizers from the view
Call this method when the control is no longer needed to prevent memory leaks and ensure all platform resources are properly released.
The method is safe to call multiple times.
OnAction
Occurs when a user interacts with any control button (play, pause, stop, settings, etc.).
public event EventHandler<SkinActionEventArgs> OnActionEvent Type
- EventHandler<SkinActionEventArgs>
Remarks
This event fires before the default action is performed, allowing you to:
- Customize or override the default behavior
- Perform validation or pre-action tasks
- Cancel the action by setting VisioForge.Core.UI.Skins.SkinActionEventArgs.HandleAndIgnore to true
The event args include the VisioForge.Core.UI.Skins.SkinElementType indicating which button was clicked.
If VisioForge.Core.UI.Skins.SkinActionEventArgs.HandleAndIgnore is set to true, the control's default action (play, pause, etc.) will not execute.
OnPlayClick
Occurs when play button clicked.
public event EventHandler OnPlayClickEvent Type
OnPreparePlayClick
Occurs when play button clicked (before play call).
public event EventHandler OnPreparePlayClickEvent Type
OnPrepareStopClick
Occurs when stop button clicked (before stop call).
public event EventHandler OnPrepareStopClickEvent Type
OnStopClick
Occurs when stop button clicked.
public event EventHandler OnStopClick