Creates a new menu item.
This method does not add the item to the menu. Please use addItem after creating the item.
The title of the menu item.
Optional
action: (() => void)The callback function to be called when the item is clicked.
Pass null
when no action is needed.
Optional
options: Partial<{ Additional options for the menu item.
enabled
: Whether the item is enabled. Defaults to true
.selected
: Whether the item is selected (has checkmark). Defaults to false
.keyBinding
: The key binding for the item, in mpv's key binding format.Generated using TypeDoc
The
Menu
module enables developers to add items to IINA's Plugin menu. An item can be a simple menu item, or a submenu item with subitems.Example
Available In Entry
Main and Global. However, the two entry points have separate sets of menu items. Menu items created in the Global entry point are available all the time, while menu items created in the Main entry point are only available when the associated window is focused. Global menu items are displayed above the Main menu items. The order of the plugin menu items is illustrated below: