@ctrl/plex
    Preparing search index...

    Class PlexClient

    Main class for interacting with a Plex client. This class can connect directly to the client and control it or proxy commands through your Plex Server. To better understand the Plex client API's read this page: https://github.com/plexinc/plex-media-player/wiki/Remote-control-API Attributes: TAG (str): 'Player' key (str): '/resources' device (str): Best guess on the type of device this is (PS, iPhone, Linux, etc). deviceClass (str): Device class (pc, phone, etc). machineIdentifier (str): Unique ID for this device. model (str): Unknown platform (str): Unknown platformVersion (str): Description product (str): Client Product (Plex for iOS, etc). protocol (str): Always seems ot be 'plex'. protocolCapabilities (list): List of client capabilities (navigation, playback, timeline, mirror, playqueues). protocolVersion (str): Protocol version (1, future proofing?) server (:class:~plexapi.server.PlexServer): Server this client is connected to. session (:class:~requests.Session): Session object used for connection. state (str): Unknown title (str): Name of this client (Johns iPhone, etc). token (str): X-Plex-Token used for authenication vendor (str): Unknown version (str): Device version (4.6.1, etc). _session (obj): Requests session object used to access this client. _proxyThroughServer (bool): Set to True after calling :func:~plexapi.client.PlexClient.proxyThroughServer() (default False).

    Index

    Constructors

    Properties

    _baseurl: string = null

    HTTP address of the client

    _proxyThroughServer: boolean = false
    _server: PlexServer = null
    _token: string = null

    Token used to access this client

    deviceClass?: string
    key: string = '/resources'
    machineIdentifier?: string
    platform?: string
    platformVersion?: string
    product?: string
    protocol?: string
    protocolCapabilities?: string[]
    protocolVersion?: string
    TAG: string = 'Player'
    timeout: number
    title?: string

    Methods

    • Alias of reload as any subsequent requests to this client will be made directly to the device even if the object attributes were initially populated from a PlexServer.

      Returns Promise<void>

    • Open the context menu on the client.

      Returns Promise<any>

    • Navigate back on the client.

      Returns Promise<any>

    • Navigate to home on the client.

      Returns Promise<any>

    • Navigate to music on the client.

      Returns Promise<any>

    • Returns true if the client is currently playing media.

      Parameters

      • includePaused: boolean = false

        If true, paused media counts as playing.

      Returns Promise<boolean>

    • Move selection down.

      Returns Promise<any>

    • Move selection left.

      Returns Promise<any>

    • Move selection right.

      Returns Promise<any>

    • Move selection up.

      Returns Promise<any>

    • Jump to next letter in lists.

      Returns Promise<any>

    • Page down in lists.

      Returns Promise<any>

    • Page up in lists.

      Returns Promise<any>

    • Pause playback.

      Parameters

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Start or resume playback.

      Parameters

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Start playback of media using a play queue.

      Parameters

      • media: any

        A Playable media item with a playlistItemID or ratingKey.

      • options: PlayMediaOptions = {}

        Playback options.

      Returns Promise<any>

    • Jump to previous letter in lists.

      Returns Promise<any>

    • Toggle or set proxy-through-server mode. When enabled, commands are sent through the Plex server rather than directly to the client.

      Parameters

      • Optionalvalue: boolean

        Enable or disable proxy mode. If omitted, toggles current state.

      • Optionalserver: PlexServer

        The PlexServer to proxy through. Required if not already set.

      Returns void

    • Main method used to handle HTTPS requests to the Plex client. This method helps by encoding the response to utf-8 and parsing the returned XML into and ElementTree object. Returns None if no data exists in the response. TODO: use headers

      Type Parameters

      • T

      Parameters

      • path: string
      • method: "put" | "get" | "post" | "patch" | "head" | "delete" = 'get'
      • Optionalheaders: Record<string, string>

      Returns Promise<T>

    • Returns Promise<void>

      PlexClient.connect

    • Seek to the specified offset in milliseconds.

      Parameters

      • offset: number

        Position in milliseconds.

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Select the current item.

      Returns Promise<any>

    • Send a command to the client, either directly or via the server proxy.

      Parameters

      • command: string

        The player command path (e.g. 'playback/play').

      • params: SendCommandParams = {}

        Additional parameters for the command.

      Returns Promise<any>

    • Set the active audio stream.

      Parameters

      • audioStreamID: number

        ID of the audio stream.

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Set repeat mode.

      Parameters

      • repeat: number

        Repeat mode (0=off, 1=repeat one, 2=repeat all).

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Set shuffle mode.

      Parameters

      • shuffle: number

        Shuffle mode (0=off, 1=on).

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Set the active subtitle stream.

      Parameters

      • subtitleStreamID: number

        ID of the subtitle stream. Use 0 to disable subtitles.

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Set the active video stream.

      Parameters

      • videoStreamID: number

        ID of the video stream.

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Set volume level.

      Parameters

      • volume: number

        Volume level (0-100).

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Skip to the next item.

      Parameters

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Skip to the previous item.

      Parameters

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Skip to a specific item by key.

      Parameters

      • key: string

        The key of the item to skip to.

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Step back (small rewind).

      Parameters

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Step forward (small fast-forward).

      Parameters

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Stop playback.

      Parameters

      • Optionalmtype: string

        Media type filter (video, music, photo).

      Returns Promise<any>

    • Poll the client for timeline data (what is currently playing).

      Parameters

      • Optionalwait: number

        Time in seconds to wait for a response.

      Returns Promise<ClientTimeline[]>

    • Toggle the on-screen display.

      Returns Promise<any>

    • Build a URL string with proper token argument. Token will be appended to the URL if either includeToken is True or TODO: CONFIG.log.show_secrets is 'true'.

      Parameters

      • key: string
      • options: { includeToken?: boolean } = {}

      Returns URL