Class VideoView
- Namespace
- VisioForge.Core.UI.Avalonia
- Assembly
- VisioForge.Core.UI.Avalonia.dll
VideoView control for Avalonia UI framework that provides cross-platform video rendering capabilities. This control serves as a container for native video rendering on different platforms (Windows, Android, iOS).
public class VideoView : Panel, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue, IChildIndexProvider, IVideoView, IDisposableInheritance
-
AvaloniaObjectAnimatableStyledElementVisualLayoutableInteractiveInputElementControlPanel
Implements
-
IDataContextProviderILogicalIThemeVariantHostIResourceHostIResourceNodeIStyleHostISetLogicalParentISetInheritanceParentIStyleableINamedIInputElementIDataTemplateHostISetterValueIChildIndexProviderIVideoView
Inherited Members
-
Panel.BackgroundPropertyPanel.Render(DrawingContext)Panel.AffectsParentArrange<TPanel>(params AvaloniaProperty[])Panel.AffectsParentMeasure<TPanel>(params AvaloniaProperty[])Panel.ChildrenChanged(object?, NotifyCollectionChangedEventArgs)Panel.IChildIndexProvider.GetChildIndex(ILogical)Panel.IChildIndexProvider.TryGetTotalCount(out int)Panel.ChildrenPanel.BackgroundPanel.IsItemsHostPanel.IChildIndexProvider.ChildIndexChangedControl.FocusAdornerPropertyControl.TagPropertyControl.ContextMenuPropertyControl.ContextFlyoutPropertyControl.RequestBringIntoViewEventControl.ContextRequestedEventControl.LoadedEventControl.UnloadedEventControl.SizeChangedEventControl.ISetterValue.Initialize(SetterBase)Control.GetTemplateFocusTarget()Control.OnLoaded(RoutedEventArgs)Control.OnUnloaded(RoutedEventArgs)Control.OnSizeChanged(SizeChangedEventArgs)Control.OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs)Control.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs)Control.OnGotFocus(GotFocusEventArgs)Control.OnLostFocus(RoutedEventArgs)Control.OnCreateAutomationPeer()Control.OnPointerReleased(PointerReleasedEventArgs)Control.OnKeyUp(KeyEventArgs)Control.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)Control.FocusAdornerControl.DataTemplatesControl.ContextMenuControl.ContextFlyoutControl.IsLoadedControl.TagControl.IDataTemplateHost.IsDataTemplatesInitializedControl.ContextRequestedControl.LoadedControl.UnloadedControl.SizeChangedInputElement.FocusablePropertyInputElement.IsEnabledPropertyInputElement.IsEffectivelyEnabledPropertyInputElement.CursorPropertyInputElement.IsKeyboardFocusWithinPropertyInputElement.IsFocusedPropertyInputElement.IsHitTestVisiblePropertyInputElement.IsPointerOverPropertyInputElement.IsTabStopPropertyInputElement.GotFocusEventInputElement.LostFocusEventInputElement.KeyDownEventInputElement.KeyUpEventInputElement.TabIndexPropertyInputElement.TextInputEventInputElement.TextInputMethodClientRequestedEventInputElement.PointerEnteredEventInputElement.PointerExitedEventInputElement.PointerMovedEventInputElement.PointerPressedEventInputElement.PointerReleasedEventInputElement.PointerCaptureLostEventInputElement.PointerWheelChangedEventInputElement.TappedEventInputElement.HoldingEventInputElement.DoubleTappedEventInputElement.Focus(NavigationMethod, KeyModifiers)InputElement.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs)InputElement.OnAccessKey(RoutedEventArgs)InputElement.OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs)InputElement.OnGotFocus(GotFocusEventArgs)InputElement.OnLostFocus(RoutedEventArgs)InputElement.OnKeyDown(KeyEventArgs)InputElement.OnKeyUp(KeyEventArgs)InputElement.OnTextInput(TextInputEventArgs)InputElement.OnPointerEntered(PointerEventArgs)InputElement.OnPointerExited(PointerEventArgs)InputElement.OnPointerMoved(PointerEventArgs)InputElement.OnPointerPressed(PointerPressedEventArgs)InputElement.OnPointerReleased(PointerReleasedEventArgs)InputElement.OnPointerCaptureLost(PointerCaptureLostEventArgs)InputElement.OnPointerWheelChanged(PointerWheelEventArgs)InputElement.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)InputElement.UpdateIsEffectivelyEnabled()InputElement.FocusableInputElement.IsEnabledInputElement.CursorInputElement.IsKeyboardFocusWithinInputElement.IsFocusedInputElement.IsHitTestVisibleInputElement.IsPointerOverInputElement.IsTabStopInputElement.IsEffectivelyEnabledInputElement.TabIndexInputElement.KeyBindingsInputElement.IsEnabledCoreInputElement.GestureRecognizersInputElement.GotFocusInputElement.LostFocusInputElement.KeyDownInputElement.KeyUpInputElement.TextInputInputElement.TextInputMethodClientRequestedInputElement.PointerEnteredInputElement.PointerExitedInputElement.PointerMovedInputElement.PointerPressedInputElement.PointerReleasedInputElement.PointerCaptureLostInputElement.PointerWheelChangedInputElement.TappedInputElement.HoldingInputElement.DoubleTappedInteractive.AddHandler(RoutedEvent, Delegate, RoutingStrategies, bool)Interactive.AddHandler<TEventArgs>(RoutedEvent<TEventArgs>, EventHandler<TEventArgs>?, RoutingStrategies, bool)Interactive.RemoveHandler(RoutedEvent, Delegate)Interactive.RemoveHandler<TEventArgs>(RoutedEvent<TEventArgs>, EventHandler<TEventArgs>?)Interactive.RaiseEvent(RoutedEventArgs)Interactive.BuildEventRoute(RoutedEvent)Layoutable.DesiredSizePropertyLayoutable.WidthPropertyLayoutable.HeightPropertyLayoutable.MinWidthPropertyLayoutable.MaxWidthPropertyLayoutable.MinHeightPropertyLayoutable.MaxHeightPropertyLayoutable.MarginPropertyLayoutable.HorizontalAlignmentPropertyLayoutable.VerticalAlignmentPropertyLayoutable.UseLayoutRoundingPropertyLayoutable.UpdateLayout()Layoutable.ApplyTemplate()Layoutable.Measure(Size)Layoutable.Arrange(Rect)Layoutable.InvalidateMeasure()Layoutable.InvalidateArrange()Layoutable.AffectsMeasure<T>(params AvaloniaProperty[])Layoutable.AffectsArrange<T>(params AvaloniaProperty[])Layoutable.MeasureCore(Size)Layoutable.MeasureOverride(Size)Layoutable.ArrangeCore(Rect)Layoutable.ArrangeOverride(Size)Layoutable.OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs)Layoutable.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs)Layoutable.OnMeasureInvalidated()Layoutable.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)Layoutable.OnVisualParentChanged(Visual?, Visual?)Layoutable.WidthLayoutable.HeightLayoutable.MinWidthLayoutable.MaxWidthLayoutable.MinHeightLayoutable.MaxHeightLayoutable.MarginLayoutable.HorizontalAlignmentLayoutable.VerticalAlignmentLayoutable.DesiredSizeLayoutable.IsMeasureValidLayoutable.IsArrangeValidLayoutable.UseLayoutRoundingLayoutable.EffectiveViewportChangedLayoutable.LayoutUpdatedVisual.BoundsPropertyVisual.ClipToBoundsPropertyVisual.ClipPropertyVisual.IsVisiblePropertyVisual.OpacityPropertyVisual.OpacityMaskPropertyVisual.EffectPropertyVisual.HasMirrorTransformPropertyVisual.RenderTransformPropertyVisual.RenderTransformOriginPropertyVisual.FlowDirectionPropertyVisual.VisualParentPropertyVisual.ZIndexPropertyVisual.GetFlowDirection(Visual)Visual.SetFlowDirection(Visual, FlowDirection)Visual.InvalidateVisual()Visual.Render(DrawingContext)Visual.AffectsRender<T>(params AvaloniaProperty[])Visual.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)Visual.LogicalChildrenCollectionChanged(object?, NotifyCollectionChangedEventArgs)Visual.OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs)Visual.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs)Visual.OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)Visual.OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)Visual.OnVisualParentChanged(Visual?, Visual?)Visual.InvalidateMirrorTransform()Visual.BoundsVisual.ClipToBoundsVisual.ClipVisual.IsEffectivelyVisibleVisual.IsVisibleVisual.OpacityVisual.OpacityMaskVisual.EffectVisual.HasMirrorTransformVisual.RenderTransformVisual.RenderTransformOriginVisual.FlowDirectionVisual.ZIndexVisual.VisualChildrenVisual.VisualRootVisual.BypassFlowDirectionPoliciesVisual.AttachedToVisualTreeVisual.DetachedFromVisualTreeStyledElement.DataContextPropertyStyledElement.NamePropertyStyledElement.ParentPropertyStyledElement.TemplatedParentPropertyStyledElement.ThemePropertyStyledElement.BeginInit()StyledElement.EndInit()StyledElement.ApplyStyling()StyledElement.InitializeIfNeeded()StyledElement.ILogical.NotifyAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)StyledElement.ILogical.NotifyDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)StyledElement.ILogical.NotifyResourcesChanged(ResourcesChangedEventArgs)StyledElement.IResourceHost.NotifyHostedResourcesChanged(ResourcesChangedEventArgs)StyledElement.TryGetResource(object, ThemeVariant?, out object?)StyledElement.ISetLogicalParent.SetParent(ILogical?)StyledElement.ISetInheritanceParent.SetParent(AvaloniaObject?)StyledElement.IStyleHost.StylesAdded(IReadOnlyList<IStyle>)StyledElement.IStyleHost.StylesRemoved(IReadOnlyList<IStyle>)StyledElement.LogicalChildrenCollectionChanged(object?, NotifyCollectionChangedEventArgs)StyledElement.OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)StyledElement.OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)StyledElement.OnDataContextChanged(EventArgs)StyledElement.OnDataContextBeginUpdate()StyledElement.OnDataContextEndUpdate()StyledElement.OnInitialized()StyledElement.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)StyledElement.NameStyledElement.ClassesStyledElement.DataContextStyledElement.IsInitializedStyledElement.StylesStyledElement.StyleKeyStyledElement.ResourcesStyledElement.TemplatedParentStyledElement.ThemeStyledElement.LogicalChildrenStyledElement.PseudoClassesStyledElement.StyleKeyOverrideStyledElement.ILogical.IsAttachedToLogicalTreeStyledElement.ParentStyledElement.ActualThemeVariantStyledElement.ILogical.LogicalParentStyledElement.ILogical.LogicalChildrenStyledElement.IResourceNode.HasResourcesStyledElement.IStyleable.ClassesStyledElement.IStyleHost.IsStylesInitializedStyledElement.IStyleHost.StylingParentStyledElement.AttachedToLogicalTreeStyledElement.DetachedFromLogicalTreeStyledElement.DataContextChangedStyledElement.InitializedStyledElement.ResourcesChangedStyledElement.ActualThemeVariantChangedAnimatable.TransitionsPropertyAnimatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)Animatable.TransitionsAvaloniaObject.CheckAccess()AvaloniaObject.VerifyAccess()AvaloniaObject.ClearValue(AvaloniaProperty)AvaloniaObject.ClearValue<T>(AvaloniaProperty<T>)AvaloniaObject.ClearValue<T>(StyledProperty<T>)AvaloniaObject.ClearValue<T>(DirectPropertyBase<T>)AvaloniaObject.Equals(object?)AvaloniaObject.GetHashCode()AvaloniaObject.GetValue(AvaloniaProperty)AvaloniaObject.GetValue<T>(StyledProperty<T>)AvaloniaObject.GetValue<T>(DirectPropertyBase<T>)AvaloniaObject.GetBaseValue<T>(StyledProperty<T>)AvaloniaObject.IsAnimating(AvaloniaProperty)AvaloniaObject.IsSet(AvaloniaProperty)AvaloniaObject.SetValue(AvaloniaProperty, object?, BindingPriority)AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority)AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T)AvaloniaObject.SetCurrentValue(AvaloniaProperty, object?)AvaloniaObject.SetCurrentValue<T>(StyledProperty<T>, T)AvaloniaObject.Bind(AvaloniaProperty, IBinding)AvaloniaObject.Bind(AvaloniaProperty, IObservable<object?>, BindingPriority)AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<object?>, BindingPriority)AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<T>, BindingPriority)AvaloniaObject.Bind<T>(StyledProperty<T>, IObservable<BindingValue<T>>, BindingPriority)AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<object?>)AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<T>)AvaloniaObject.Bind<T>(DirectPropertyBase<T>, IObservable<BindingValue<T>>)AvaloniaObject.CoerceValue(AvaloniaProperty)AvaloniaObject.UpdateDataValidation(AvaloniaProperty, BindingValueType, Exception?)AvaloniaObject.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)AvaloniaObject.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)AvaloniaObject.RaisePropertyChanged<T>(DirectPropertyBase<T>, T, T)AvaloniaObject.SetAndRaise<T>(DirectPropertyBase<T>, ref T, T)AvaloniaObject.InheritanceParentAvaloniaObject.this[AvaloniaProperty]AvaloniaObject.this[IndexerDescriptor]AvaloniaObject.PropertyChangedAvaloniaObject.INotifyPropertyChanged.PropertyChanged
Constructors
VideoView()
Initializes a new instance of the VisioForge.Core.UI.Avalonia.VideoView class. Sets up the native control host, default size, and background color for video rendering.
public VideoView()Methods
AttachPipeline(MediaBlocksPipeline)
Attaches a media blocks pipeline to the video view for processing. This method is not implemented in the current version.
public void AttachPipeline(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The media blocks pipeline to attach.
CallInvoke(Delegate, params object[])
Invokes a delegate method with optional arguments. This method is provided for API compatibility but has no implementation in Avalonia.
public void CallInvoke(Delegate method, params object[] args)Parameters
methodDelegate-
The delegate method to invoke.
argsobject[]-
Optional arguments to pass to the method.
CallRefresh()
Calls a refresh operation on the video view. This method is provided for API compatibility but has no implementation in Avalonia.
public void CallRefresh()ClearUI()
Clears the user interface elements of the video view. This method is provided for API compatibility but has no implementation.
public void ClearUI()DetachPipeline()
Detaches the currently attached media blocks pipeline from the video view. This method is not implemented in the current version.
public void DetachPipeline()Dispose(bool)
Releases unmanaged and optionally managed resources.
protected virtual void Dispose(bool disposing)Parameters
disposingbool-
Set to
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. Implements the IDisposable pattern for proper cleanup.
public void Dispose()~VideoView()
Finalizes an instance of the VisioForge.Core.UI.Avalonia.VideoView class.
protected ~VideoView()GetBackgroundColor()
Gets the background color of the video view as an SKColor.
public SKColor GetBackgroundColor()Returns
- SKColor
-
The background SkiaSharp.SKColor, or black if no background is set.
GetHandle()
Gets the native window handle if available for the current platform. On Android and iOS, this returns IntPtr.Zero as those platforms don't expose window handles.
public nint GetHandle()Returns
GetInvokeRequired()
Gets a value indicating whether the caller must use Invoke when calling methods on the control. In Avalonia, this always returns false as thread marshaling is handled differently.
public bool GetInvokeRequired()Returns
- bool
-
Always returns
falsein Avalonia.
GetIsHandleCreated()
Gets a value indicating whether the native window handle has been created.
public bool GetIsHandleCreated()Returns
- bool
-
trueif the handle is created and valid; otherwise,false.
GetSize()
Gets the actual size of the video view control in device-independent pixels. On Windows, this accounts for DPI scaling to return the physical size.
public Size GetSize()Returns
- Size
-
A VisioForge.Core.Types.Size structure containing the width and height.
GetUIEngine()
Gets the UI engine type used for video rendering. Returns platform-specific engine: Android_TextureView on Android, Apple_Metal on iOS, or Avalonia on other platforms.
public VideoViewUIEngine GetUIEngine()Returns
- VideoViewUIEngine
-
The VisioForge.Core.Types.VideoViewUIEngine enum value indicating the rendering engine in use.
InvokeStart()
Invokes the start operation by adding the native control host to the visual tree. Called when video playback or capture is about to begin.
public void InvokeStart()InvokeStartComplete()
Invokes operations to complete the start process. This method is intentionally left empty as no additional operations are required.
public void InvokeStartComplete()InvokeStop()
Invokes the stop operation by removing the native control host from the visual tree. Called when video playback or capture is stopping.
public void InvokeStop()InvokeVideoRendererUpdate()
Invokes a video renderer update operation. This method is intentionally left empty as the Avalonia implementation handles updates automatically.
public void InvokeVideoRendererUpdate()LogDialogClear()
Clears the contents of the log dialog. This method is provided for API compatibility but has no implementation in Avalonia.
public void LogDialogClear()LogDialogClose()
Closes the log dialog window. This method is provided for API compatibility but has no implementation in Avalonia.
public void LogDialogClose()LogDialogError(string)
Logs an error message to the dialog. This method is provided for API compatibility but has no implementation in Avalonia.
public void LogDialogError(string msg)Parameters
msgstring-
The error message to log.
PushMouseButtonDown(int, int, MouseButton)
Raises the OnMouseButtonDown event with the specified coordinates and button.
public void PushMouseButtonDown(int x, int y, MouseButton button)Parameters
xint-
The X coordinate of the mouse pointer in pixels.
yint-
The Y coordinate of the mouse pointer in pixels.
buttonMouseButton-
The mouse button that was pressed.
PushMouseButtonUp(int, int, MouseButton)
Raises the OnMouseButtonUp event with the specified coordinates and button.
public void PushMouseButtonUp(int x, int y, MouseButton button)Parameters
xint-
The X coordinate of the mouse pointer in pixels.
yint-
The Y coordinate of the mouse pointer in pixels.
buttonMouseButton-
The mouse button that was released.
PushMouseMove(int, int)
Raises the OnMouseMoved event with the specified mouse coordinates.
public void PushMouseMove(int x, int y)Parameters
xint-
The X coordinate of the mouse pointer in pixels.
yint-
The Y coordinate of the mouse pointer in pixels.
Refresh()
Refreshes the control's visual state. This method is provided for API compatibility but has no implementation in the Avalonia version.
public void Refresh()ResizeRoundTo(int)
Resizes the video view to be a multiple of the specified value. This method is provided for API compatibility but has no implementation in Avalonia.
public void ResizeRoundTo(int round)Parameters
roundint-
The value to round the dimensions to.
SetHandle(nint)
Sets the native window handle for the video view. This method is not implemented in the Avalonia version as handles are managed internally.
public void SetHandle(nint handle)Parameters
handlenint-
The native window handle to set.
Exceptions
- NotImplementedException
-
Always thrown as this operation is not supported.
ShowMessage(string)
Shows a message dialog to the user. In the current implementation, this always returns OK without displaying a dialog.
public MessageBoxResult ShowMessage(string message)Parameters
messagestring-
The message text to display.
Returns
- MessageBoxResult
-
Always returns VisioForge.Core.Types.MessageBoxResult.OK.
ShowMessageEx(string, string, MessageBoxDialogButtons)
Shows an extended message dialog with custom caption and button configuration.
public MessageBoxResult ShowMessageEx(string message, string caption, MessageBoxDialogButtons buttons)Parameters
messagestring-
The message text to display.
captionstring-
The dialog window caption/title.
buttonsMessageBoxDialogButtons-
The button configuration to display in the dialog.
Returns
- MessageBoxResult
-
The VisioForge.Core.Types.MessageBoxResult indicating which button was clicked.
OnMouseButtonDown
Occurs when a mouse button is pressed down over the video view.
public event EventHandler<MouseButtonEventArgs> OnMouseButtonDownEvent Type
- EventHandler<MouseButtonEventArgs>
OnMouseButtonUp
Occurs when a mouse button is released over the video view.
public event EventHandler<MouseButtonEventArgs> OnMouseButtonUpEvent Type
- EventHandler<MouseButtonEventArgs>
OnMouseMoved
Occurs when the mouse pointer moves over the video view.
public event EventHandler<MouseMoveEventArgs> OnMouseMovedEvent Type
- EventHandler<MouseMoveEventArgs>