Skip to main content
Corvus Connection

ISpotifyApi

Interface
TheOmenDen.StreamPulse.Scripting.ISpotifyApiPlayback-control operations available inside a script handler, bound to the streamer's connected Spotify account. Every method is failure-safe: a Spotify API error, a missing/expired token, no active device, or a network fault is logged (with confidential data stripped) and swallowed — it never throws, so a failing call can never crash the host or escape a node. Mutating calls no-op on failure; GetNowPlayingAsync reports null.

Members

10
  • GetNowPlayingAsync
    method
    Task<SpotifyNowPlaying> GetNowPlayingAsync(CancellationToken cancellationToken = default)
    The currently-playing track, or null when nothing is playing (or on error). Lets a graph branch on what's playing without a try/catch.
  • NextAsync
    method
    Task NextAsync(CancellationToken cancellationToken = default)
    Skips to the next track in the queue.
  • PauseAsync
    method
    Task PauseAsync(CancellationToken cancellationToken = default)
    Pauses playback on the active device.
  • PlayAsync
    method
    Task PlayAsync(CancellationToken cancellationToken = default)
    Resumes playback on the active device.
  • PlayContextAsync
    method
    Task PlayContextAsync(string contextUri, CancellationToken cancellationToken = default)
    Starts playback of a context — a playlist or album — by its Spotify URI (e.g. spotify:playlist:37i9dQZF1DX…). A blank URI no-ops.
  • PreviousAsync
    method
    Task PreviousAsync(CancellationToken cancellationToken = default)
    Skips to the previous track.
  • RestartAsync
    method
    Task RestartAsync(CancellationToken cancellationToken = default)
    Restarts the current track by seeking to position 0.
  • SetRepeatAsync
    method
    Task SetRepeatAsync(string mode, CancellationToken cancellationToken = default)
    Sets the repeat mode. mode is off, track, or context; any unrecognized value is treated as off.
  • SetShuffleAsync
    method
    Task SetShuffleAsync(bool enabled, CancellationToken cancellationToken = default)
    Turns shuffle on or off.
  • SetVolumeAsync
    method
    Task SetVolumeAsync(int percent, CancellationToken cancellationToken = default)
    Sets the playback volume; percent is clamped to 0..100.