Options
All
  • Public
  • Public/Protected
  • All
Menu

The Spotify Remote Api allows remote control of Spotify Application

See the example shown for SpotifyAuth

export
interface

SpotifyRemoteApi

Hierarchy

Index

Methods

addListener

connect

  • connect(accessToken: string): Promise<void>
  • Connect to Spotify Application via the access token

    memberof

    SpotifyRemoteApi

    Parameters

    • accessToken: string

    Returns Promise<void>

disconnect

  • disconnect(): Promise<void>
  • Disconnects the App Remote

    memberof

    SpotifyRemoteApi

    Returns Promise<void>

emit

eventNames

  • eventNames(): ("playerStateChanged" | "playerContextChanged" | "remoteDisconnected" | "remoteConnected")[]
  • Returns ("playerStateChanged" | "playerContextChanged" | "remoteDisconnected" | "remoteConnected")[]

getChildrenOfItem

getContentItemForUri

  • getContentItemForUri(uri: string): Promise<undefined | ContentItem>
  • Gets a ContentItem from a uri (iOS only)

    memberof

    SpotifyRemoteApi

    Parameters

    • uri: string

    Returns Promise<undefined | ContentItem>

getCrossfadeState

getPlayerState

getRecommendedContentItems

getRootContentItems

  • getRootContentItems(type?: "default" | "fitness" | "navigation"): Promise<ContentItem[]>
  • Retrieves the root content items for a given type. (iOS only)

    memberof

    SpotifyRemoteApi

    Parameters

    • Optional type: "default" | "fitness" | "navigation"

    Returns Promise<ContentItem[]>

isConnectedAsync

  • isConnectedAsync(): Promise<boolean>
  • Asynchronous call to get whether or not the Spotify Remote is connected

    memberof

    SpotifyNativeApi

    Returns Promise<boolean>

listenerCount

  • listenerCount<K>(type: K): number
  • Type parameters

    • K: "playerStateChanged" | "playerContextChanged" | "remoteDisconnected" | "remoteConnected"

    Parameters

    • type: K

    Returns number

off

on

pause

  • pause(): Promise<void>

playItem

playItemWithIndex

  • playItemWithIndex(item: ContentItem, skipToTrackIndex: number): Promise<void>
  • Plays an item (like a playlist), skipping to a particular track inside

    memberof

    SpotifyRemoteApi

    Parameters

    • item: ContentItem

      item to play (usually a playlist)

    • skipToTrackIndex: number

      track in playlist to skip to

    Returns Promise<void>

playUri

  • playUri(spotifyUri: string): Promise<void>
  • Play a track, album, playlist or artist via spotifyUri Example: spotify:track:, spotify:album:, spotify:playlist:, spotify:artist:

    memberof

    SpotifyNativeApi

    Parameters

    • spotifyUri: string

    Returns Promise<void>

queueUri

  • queueUri(spotifyUri: string): Promise<void>
  • Queues the track given by spotifyUri in Spotify example: spotify:track:

    memberof

    SpotifyNativeApi

    Parameters

    • spotifyUri: string

    Returns Promise<void>

removeAllListeners

  • removeAllListeners<K>(event?: K): void
  • Type parameters

    • K: "playerStateChanged" | "playerContextChanged" | "remoteDisconnected" | "remoteConnected"

    Parameters

    • Optional event: K

    Returns void

removeListener

resume

  • resume(): Promise<void>

seek

  • seek(positionMs: number): Promise<void>
  • Seeks to a position within a song

    memberof

    SpotifyRemoteApi

    Parameters

    • positionMs: number

      Position in milliseconds

    Returns Promise<void>

setPlaying

  • setPlaying(playing: boolean): Promise<void>
  • deprecated

    Please use resume and pause instead

    memberof

    SpotifyJSApi

    Parameters

    • playing: boolean

    Returns Promise<void>

setRepeatMode

setShuffling

  • setShuffling(shuffling: boolean): Promise<void>
  • Sets shuffling

    memberof

    SpotifyRemoteApi

    Parameters

    • shuffling: boolean

    Returns Promise<void>

skipToNext

  • skipToNext(): Promise<void>
  • Skips to next item in context

    memberof

    SpotifyRemoteApi

    Returns Promise<void>

skipToPrevious

  • skipToPrevious(): Promise<void>
  • Skips to previous item in context

    memberof

    SpotifyRemoteApi

    Returns Promise<void>

Legend

  • Property
  • Method

Generated using TypeDoc