Thanks to visit codestin.com
Credit goes to docs.iina.io

Interface Core

The Core module provides methods that control the player's main functions. It also has the following members to control the tracks, the player window, and the player status:

Example

// pause the playback
core.pause();

// display a message (OSD) at the top of the window
core.osd("The plugin is running!");

// get the names of all subtitle tracks
let subtitles = core.subtitle.tracks.map(track => track.title);

Available In Entry

Main entry only

Hierarchy

  • Core

Methods

  • Open a new file in the current player window.

    Parameters

    • url: string

      The URL or file path of the media.

    Returns void

  • Display an On Screen Display (OSD) message at the top of the window.

    Parameters

    • message: string

      The message to display.

    Returns void

  • Pause the playback.

    Returns void

  • Resume the playback.

    Returns void

  • Stop the playback and close the file.

    Returns void

  • Seek (jump) forward or backward in the current file.

    Remarks

    Use mpv's seek command for advanced seeking.

    Seealso

    core.status.duration for getting the duration of the current file.

    Parameters

    • seconds: number

      The number of seconds to seek. Can be negative (backward).

    • exact: boolean

      Whether to seek exactly to the given position. If false, the seek will be performed in the nearest keyframe.

    Returns void

  • Seek (jump) to a specific position in the current file.

    Remarks

    Use mpv's seek command for advanced seeking.

    Seealso

    core.status.duration for getting the duration of the current file.

    Parameters

    • seconds: number

      The number of seconds to seek to.

    Returns any

  • Set the playback speed.

    Remarks

    Equivalent to setting the mpv speed property.

    Parameters

    • speed: number

      The speed to set. 1.0 is normal speed, 2.0 is twice as fast, 0.5 is half speed, etc.

    Returns any

  • Seek to a specific chapter.

    Remarks

    Basically, IINA seeks to the start time of the chapter.

    Parameters

    • index: number

      The index of the chapter to play, starting from 0. The chapter list can be obtained from getChapters.

    Returns any

  • Returns the version information of IINA and mpv.

    Returns {
        iina: string;
        build: string;
        mpv: string;
    }

    • iina: string
    • build: string
    • mpv: string

Properties

window: WindowAPI

See the linked interface's documentation for more details.

status: StatusAPI

See the linked interface's documentation for more details.

audio: AudioAPI

See the linked interface's documentation for more details.

video: VideoAPI

See the linked interface's documentation for more details.

subtitle: SubtitleAPI

See the linked interface's documentation for more details.

Generated using TypeDoc