Class KodiPlayerNamespace

Constructors

Methods

  • Adds a subtitle to the player.

    Parameters

    • playerid: number

      The ID of the player.

    • subtitle: string

      The local path or remote URL to the subtitle file to load.

    Returns Promise<string>

    A promise resolving to a string, typically empty on success.

  • Gets the audio delay for the current playback.

    Returns Promise<{ offset: number }>

    A promise resolving to the audio delay offset.

  • Retrieves the currently played item.

    Parameters

    • playerid: number

      The ID of the player.

    • Optionalproperties: string[]

      The properties to retrieve for the item.

    Returns Promise<{ item: PlayerMediaItem }>

    A promise resolving to the currently played item.

  • Retrieves a list of available players.

    Parameters

    • media: "video" | "audio" | "all" = "all"

      The type of media (e.g., 'all', 'video', 'audio').

    Returns Promise<
        {
            name: string;
            playsaudio: boolean;
            playsvideo: boolean;
            type: PlayerType;
        }[],
    >

    A promise resolving to an array of available players.

  • Retrieves the values of the given properties for a player.

    Parameters

    • playerid: number

      The ID of the player.

    • properties: PlayerPropertyName[]

      The properties to retrieve.

    Returns Promise<any>

    A promise resolving to the requested properties and their values.

  • Gets the view mode of the video player.

    Returns Promise<
        {
            nonlinearstretch: boolean;
            pixelratio: number;
            verticalshift: number;
            viewmode: PlayerViewMode;
            zoom: number;
        },
    >

    A promise resolving to the view mode details.

  • Goes to the previous, next, or a specific position in the playlist.

    Parameters

    • playerid: number

      The ID of the player.

    • to: PlayerGoTo

      The target to go to ('previous', 'next', or a specific position).

    Returns Promise<string>

    A promise resolving to a string, typically empty on success.

  • Moves the viewport or skips playback based on the current state.

    Parameters

    • playerid: number

      The ID of the player.

    • direction: PlayerMoveDirection

      The direction to move ('left', 'right', 'up', 'down').

    Returns Promise<string>

    A promise resolving to a string, typically empty on success.

  • Starts playback of a playlist, slideshow, single file, or database item.

    Parameters

    • item: any

      The item to play.

    • Optionaloptions: PlayerOptions

      Optional playback options.

    Returns Promise<string>

    A promise resolving to a string, typically empty on success.

  • Pauses or unpauses playback and returns the new state.

    Parameters

    • playerid: number

      The ID of the player.

    • play: boolean | "toggle" = "toggle"

      The toggle state ('toggle' by default).

    Returns Promise<number>

    A promise resolving to the new playback speed.

  • Rotates the current picture.

    Parameters

    • playerid: number

      The ID of the player.

    • value: "clockwise" | "counterclockwise"

      The direction to rotate ('clockwise' or 'counterclockwise').

    Returns Promise<string>

    A promise resolving to a string, typically empty on success.

  • Seeks through the playing item.

    Parameters

    • playerid: number

      The ID of the player.

    • value: PlayerSeekValue

      The seek value (percentage, time, step, or seconds).

    Returns Promise<{ percentage?: number; time?: string; totaltime?: string }>

    A promise resolving to the new playback position.

  • Sets the audio delay for the current playback.

    Parameters

    • playerid: number

      The ID of the player.

    • offset: number | "increment" | "decrement"

      The offset value to set.

    Returns Promise<{ offset: number }>

    A promise resolving to the new audio delay offset.

  • Sets the audio stream played by the player.

    Parameters

    • playerid: number

      The ID of the player.

    • stream: number | "next" | "previous"

      The audio stream to set ('previous', 'next', or stream index).

    Returns Promise<string>

    A promise resolving to a string, typically empty on success.

  • Turns partymode on or off.

    Parameters

    • playerid: number

      The ID of the player.

    • partymode: boolean | "toggle"

      The toggle state ('toggle' by default).

    Returns Promise<string>

    A promise resolving to a string, typically empty on success.

  • Sets the repeat mode of the player.

    Parameters

    • playerid: number

      The ID of the player.

    • repeat: PlayerRepeat | "cycle"

      The repeat mode ('off', 'one', 'all', or 'cycle').

    Returns Promise<string>

    A promise resolving to a string, typically empty on success.

  • Shuffles or unshuffles items in the player.

    Parameters

    • playerid: number

      The ID of the player.

    • shuffle: boolean | "toggle"

      The toggle state ('toggle' by default).

    Returns Promise<string>

    A promise resolving to a string, typically empty on success.

  • Sets the speed of the current playback.

    Parameters

    • playerid: number

      The ID of the player.

    • speed:
          | 0
          | "increment"
          | "decrement"
          | 32
          | -32
          | 16
          | -16
          | 8
          | -8
          | 4
          | -4
          | 2
          | -2
          | 1
          | -1

      The speed value to set (-32 to 32 or increment/decrement).

    Returns Promise<number>

    A promise resolving to the new playback speed.

  • Sets the subtitle displayed by the player.

    Parameters

    • playerid: number

      The ID of the player.

    • subtitle: number | "next" | "previous" | "off" | "on"

      The subtitle to set ('previous', 'next', 'off', 'on', or subtitle index).

    • enable: boolean = false

      Whether to enable subtitles after setting (default: false).

    Returns Promise<string>

    A promise resolving to a string, typically empty on success.

  • Sets the tempo of the current playback.

    Parameters

    • playerid: number

      The ID of the player.

    • tempo: number | "increment" | "decrement"

      The tempo value to set.

    Returns Promise<number>

    A promise resolving to the new tempo.

  • Sets the video stream played by the player.

    Parameters

    • playerid: number

      The ID of the player.

    • stream: number | "next" | "previous"

      The video stream to set ('previous', 'next', or stream index).

    Returns Promise<string>

    A promise resolving to a string, typically empty on success.

  • Stops playback.

    Parameters

    • playerid: number

      The ID of the player.

    Returns Promise<string>

    A promise resolving to a string, typically empty on success.

  • Zooms the current picture.

    Parameters

    • playerid: number

      The ID of the player.

    • zoom: number | "in" | "out"

      The zoom action ('in', 'out', or zoom level).

    Returns Promise<string>

    A promise resolving to a string, typically empty on success.