Interface Menu

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.


// create a menu to choose subtitle tracks
const subTracksMenu = menu.item("Subtitle Track");

// add a submenu item for each track
for (const track of core.subtitle.tracks) {
// when clicked, set the subtitle track
() => { = },
// show checkmark if the track is currently selected
{ selected: === }
// add the menu to IINA's Plugin menu

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:

Plugin 1 - Global menu item 1
Plugin 1 - Global menu item 2
Plugin 1 - Main menu item 1 ─┬──► Available when the window is focused
Plugin 1 - Main menu item 2 ─┘
Plugin 2 - Global menu item 1


  • Menu


  • Creates a new menu item.


    This method does not add the item to the menu. Please use addItem after creating the item.


    • title: string

      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.

        • (): void
        • Returns void

    • Optional options: Partial<{
          enabled: boolean;
          selected: boolean;
          keyBinding: string;

      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.

    Returns MenuItem

  • Adds a menu item to IINA's Plugin menu.


    Returns void

  • Remove a menu item from IINA's Plugin menu.


    • index: number

      The index of the menu item to remove, starting from 0.

    Returns void

  • Remove all menu items for this plugin.

    Returns void

  • Refresh the Plugin menu.

    Returns void

Generated using TypeDoc