Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • PlayerApi

Index

Constructors

constructor

Properties

Private http

http: Http

Methods

addToQueue

  • Add an Item to the User's Playback Queue

    Add an item to the end of the user's current playback queue.

    Parameters

    • uri: string

      The uri of the track or episode to add to the queue.

    • Optional options: DeviceIdOptions

      Optional request information.

    Returns Promise<void>

getCurrentlyPlayingTrack

getMyDevices

  • getMyDevices(): Promise<Device[]>
  • Get a User's Available Devices

    Get information about a user's available devices.

    Returns Promise<Device[]>

getPlaybackInfo

  • Get Information About the User's Current Playback

    Get information about the user's current playback state, including track or episode, track progress, and active device.

    Parameters

    Returns Promise<CurrentlyPlayingContext>

getRecentlyPlayedTracks

pause

  • Pause a User's Playback

    Pause playback on the user's account.

    Parameters

    Returns Promise<void>

play

  • Start or Resume a User's Playback

    Start a new context or resume current playback on the user's active device.

    Parameters

    • Optional options: PlayOptions

      Optional request information.

    Returns Promise<void>

seek

  • Seek to a Position in the Currently Playing Track

    Seeks to the given position in the user's currently playing track.

    Parameters

    • positionMs: number

      The position in milliseconds to seek to.

    • Optional options: DeviceIdOptions

      Optional request information.

    Returns Promise<void>

setRepeat

  • Set the Repeat Mode for the User's Playback

    Set the repeat mode for the user's playback.

    Parameters

    Returns Promise<void>

setShuffle

  • Toggle Shuffle For User's Playback

    Toggle shuffle on or off for user's playback.

    Parameters

    • state: boolean

      The desired shuffle state.

    • Optional options: DeviceIdOptions

      Optional request information.

    Returns Promise<void>

setVolume

  • setVolume(volumePercent: number, options?: DeviceIdOptions): Promise<void>
  • Set Volume For User's Playback

    Set the volume for the user's current playback device.

    Parameters

    • volumePercent: number

      The volume to set.

    • Optional options: DeviceIdOptions

      Optional request information.

    Returns Promise<void>

skipToNext

  • Skip User's Playback To Next Track

    Skips to next track in the user's queue.

    Parameters

    Returns Promise<void>

skipToPrevious

  • Skip User's Playback To Previous Track

    Skips to previous track in the user's queue.

    Parameters

    Returns Promise<void>

transferPlayback

  • Transfer a User's Playback

    Transfer playback to a new device and determine if it should start playing.

    Parameters

    • deviceId: string

      The ID of the device on which playback should be started/transferred.

    • Optional options: TransferPlaybackOptions

      Optional request information.

    Returns Promise<void>

Generated using TypeDoc