Interface SidebarView

The SidebarView module provides a way to display custom content in the sidebar. The content is rendered in a webview, therefore you can load webpages, display information such as lyrics, or additional playback controls.

You should add a sidebarTab field in the plugin Info.json when using this module:

{
"sidebarTab": { name: "Title" }
}

The webview has its own JavaScript context, which cannot access the IINA API directly. It can only communicate with the plugin script via iina.postMessage and iina.onMessage to exchange data. See API in Web Views for more information.

Available In Entry

Main only.

Hierarchy

  • SidebarView

Methods

  • Show the sidebar and switch to the plugin's tab.

    Returns void

  • Load an HTML file into the webview.

    Parameters

    • path: string

      The path to the HTML file, related to the plugin root directory.

    Returns void

  • Post a message to the webview. The JS environment inside the sidebar view also has two methods, iina.postMessage and iina.onMessage, to exchange data with the plugin script. See API in Web Views for more information.

    Parameters

    • name: string

      The message name.

    • data: any

      The message data.

    Returns void

  • Register a listener for messages posted by the sidebar view. The JS environment inside the window also has two methods, iina.postMessage and iina.onMessage, to exchange data with the plugin script. See API in Web Views for more information.

    Parameters

    • name: string

      The message name.

    • callback: ((data: any) => void)

      The callback to be called when a message with the given name is received.

        • (data: any): void
        • Parameters

          • data: any

          Returns void

    Returns void

Generated using TypeDoc