# VideoNode
Class Inherits MediaNode
## About
`VideoNode` represents a video URL or local video file. It displays a static preview until selected and then uses the embedded media player supplied by `MediaNode`.
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| ActionItem | index As Integer | ToolbarItem | Returns the contextual toolbar item at the specified index. |
| ConfigureEmbeddedPlayer | player As DesktopMoviePlayer | (None) | Configures the embedded movie player when it is created. |
| Constructor | (None) | (None) | Creates a new video node instance initialized from the supplied values. |
| Constructor | file As FolderItem <br> preview As Picture = Nil | (None) | Creates a new video node instance initialized from the supplied values. |
| Constructor | url As String <br> preview As Picture = Nil | (None) | Creates a new video node instance initialized from the supplied values. |
| DroppedFileImportPriority | file As FolderItem | Integer | Returns this node type's priority for importing a dropped file, or a negative value when unsupported. |
| DroppedFileTypes | (None) | String | Returns the file MIME types this node wants the editor to accept for dropping. |
| DroppedTextImportPriority | value As String | Integer | Returns this node type's priority for importing dropped text or a URL, or a negative value when unsupported. |
| Duplicate | (None) | Node | Returns an independent copy of this node and its configurable state. |
| EmbeddedControlBounds | bounds As Rect | Rect | Returns the bounds of the embedded player within the supplied node bounds. |
| FromHTML | element As GraffitiProEditor.HTMLSupport.HTMLElement | Boolean | Imports supported content and formatting from an HTML element and returns whether it succeeded. |
| FromJSON | data As JSONItem | Boolean | Restores state from JSON data and returns whether it succeeded. |
| HTMLTags | (None) | String | Returns the HTML tag names supported by this node type. |
| ImportDroppedFile | file As FolderItem | Boolean | Imports a dropped file into this node instance. |
| ImportDroppedText | value As String | Boolean | Imports dropped text or a URL into this node instance. |
| LastActionIndex | (None) | Integer | Returns the last zero-based action index supplied by this node, or -1 when there are no actions. |
| LocalizeToolbarItem | strings As GraffitiProEditor.Editor | (None) | Sets this node type's toolbar item text from the supplied editor's localization properties. The editor calls it when the type is registered, when the editor opens, and when a locale pack is applied to the editor. A custom node type can override it to localize its own toolbar item. |
| MediaFileFilter | (None) | String | Returns the open-file dialog filter for choosing this node's media file. Subclasses return their formats; empty allows any file. |
| PerformAction | index As Integer <br> selectedItem As DesktopMenuItem | (None) | Handles the contextual toolbar action at the specified index. |
| PerformToolbarAction | editor As Editor <br> selectedItem As DesktopMenuItem | (None) | Handles activation of this node type's main-toolbar item. |
| PreferredHeight | g As Graphics <br> availableWidth As Double | Double | Returns the preferred node height for the available width. |
| Render | g As Graphics <br> bounds As Rect <br> selected As Boolean | (None) | Draws the node within the supplied document bounds. |
| ToHTML | (None) | String | Returns an HTML representation of this content. |
| ToJSON | (None) | JSONItem | Returns a JSON representation of this object's persistent state. |
| ToMarkdown | (None) | String | Returns a Markdown representation of this content. |
| TypeName | (None) | String | Returns the display name for this node type. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| PreviewImage | Picture | (None) | Gets or sets the preview image. |
## Notes
On Windows and Linux, playback streams remote HTML5 media directly in `DesktopHTMLViewer`. macOS uses the native media player.
### JSON Format
`previewImage` contains Base64-encoded PNG bytes without a data-URI prefix and is omitted when no preview picture is assigned. The video source uses the inherited `MediaNode` JSON fields.
### Linux Playback
Linux uses the same HTML5 `DesktopHTMLViewer` playback path as Windows and streams remote media without downloading the complete resource first. Playback still depends on the Linux distribution's WebKit and installed media codecs, so a source may remain unavailable even though the node can still display its static preview and can still be edited and exported.
### Preview and Compatibility
Supply an explicit preview `Picture` when a platform cannot extract or display the first frame of the selected media format. Windows playback depends on WebView2's HTML5 codec support, Linux playback depends on WebKit and the distribution's media codecs, and macOS playback depends on the codecs available to Xojo's native `DesktopMoviePlayer`.
## Examples
Register a video prototype before inserting or importing video.
### Video with Preview
```xojo
Editor.AddNode(New GraffitiProEditor.VideoNode(videoFile, previewPicture))
```