Spotify.NET/web/player.html

41 lines
28 KiB
HTML
Raw Normal View History

2019-08-16 23:41:36 +01:00
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Player | SpotifyAPI-NET</title>
2019-08-16 23:45:09 +01:00
<meta name="description" content="🔉 An API for the Spotify-Client and the Spotify Web API, written in C#/.NET">
2019-08-16 23:41:36 +01:00
2019-10-21 09:40:43 +01:00
<link rel="preload" href="/SpotifyAPI-NET/assets/css/0.styles.70d78a90.css" as="style"><link rel="preload" href="/SpotifyAPI-NET/assets/js/app.b3b376a4.js" as="script"><link rel="preload" href="/SpotifyAPI-NET/assets/js/2.db6f1a12.js" as="script"><link rel="preload" href="/SpotifyAPI-NET/assets/js/19.c6343cc0.js" as="script"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/10.29899bd4.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/11.71e8ae3b.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/12.aa6c4bc3.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/13.1731261a.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/14.5c5c08c0.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/15.a0fc535e.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/16.427ccfec.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/17.a281444b.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/18.1f840ba3.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/20.f7f0836a.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/21.401b13b4.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/22.cfa8f8db.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/23.0dd8fbde.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/24.0e78cfc0.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/25.aae27f67.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/26.3876e2f9.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/3.e41cd288.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/4.d34ebd53.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/5.85e9957e.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/6.06a21323.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/7.6ce7959d.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/8.26b7beaf.js"><link rel="prefetch" href="/SpotifyAPI-NET/assets/js/9.2255e63f.js">
2019-08-16 23:45:09 +01:00
<link rel="stylesheet" href="/SpotifyAPI-NET/assets/css/0.styles.70d78a90.css">
2019-08-16 23:41:36 +01:00
</head>
<body>
2019-08-16 23:45:09 +01:00
<div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/SpotifyAPI-NET/" class="home-link router-link-active"><!----> <span class="site-name">SpotifyAPI-NET</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/SpotifyAPI-NET/" class="nav-link">Home</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">SpotifyAPI.Web</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/getting_started.html" class="nav-link">Getting Started</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/examples.html" class="nav-link">Examples</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/proxy.html" class="nav-link">Proxy</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/albums.html" class="nav-link">- Albums</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/artists.html" class="nav-link">- Artists</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/browse.html" class="nav-link">- Browse</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/follow.html" class="nav-link">- Follow</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/library.html" class="nav-link">- Library</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/personalization.html" class="nav-link">- Personalization</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/player.html" class="nav-link router-link-exact-active router-link-active">- Player</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/playlists.html" class="nav-link">- Playlists</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/profiles.html" class="nav-link">- Profiles</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/search.html" class="nav-link">- Search</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/tracks.html" class="nav-link">- Tracks</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/utils.html" class="nav-link">Utilities</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">SpotifyAPI.Auth</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/getting_started.html" class="nav-link">Getting Started</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/implicit_grant.html" class="nav-link">- ImplicitGrantAuth</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/token_swap.html" class="nav-link">- TokenSwapAuth</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/authorization_code.html" class="nav-link">- AutorizationCodeAuth</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/client_credentials.html" class="nav-link">- ClientCredentialsAuth</a></li></ul></div></div> <a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET" target="_blank" rel="noopener noreferrer" class="repo-link">
2019-08-16 23:41:36 +01:00
🚀 GitHub
2019-08-16 23:45:09 +01:00
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/SpotifyAPI-NET/" class="nav-link">Home</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">SpotifyAPI.Web</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/getting_started.html" class="nav-link">Getting Started</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/examples.html" class="nav-link">Examples</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/proxy.html" class="nav-link">Proxy</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/albums.html" class="nav-link">- Albums</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/artists.html" class="nav-link">- Artists</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/browse.html" class="nav-link">- Browse</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/follow.html" class="nav-link">- Follow</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/library.html" class="nav-link">- Library</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/personalization.html" class="nav-link">- Personalization</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/player.html" class="nav-link router-link-exact-active router-link-active">- Player</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/playlists.html" class="nav-link">- Playlists</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/profiles.html" class="nav-link">- Profiles</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/search.html" class="nav-link">- Search</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/tracks.html" class="nav-link">- Tracks</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/web/utils.html" class="nav-link">Utilities</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">SpotifyAPI.Auth</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/getting_started.html" class="nav-link">Getting Started</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/implicit_grant.html" class="nav-link">- ImplicitGrantAuth</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/token_swap.html" class="nav-link">- TokenSwapAuth</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/authorization_code.html" class="nav-link">- AutorizationCodeAuth</a></li><li class="dropdown-item"><!----> <a href="/SpotifyAPI-NET/auth/client_credentials.html" class="nav-link">- ClientCredentialsAuth</a></li></ul></div></div> <a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET" target="_blank" rel="noopener noreferrer" class="repo-link">
2019-08-16 23:41:36 +01:00
🚀 GitHub
2019-08-16 23:45:09 +01:00
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></nav> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>Player</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/SpotifyAPI-NET/web/player.html#getdevices" class="sidebar-link">GetDevices</a></li><li><a href="/SpotifyAPI-NET/web/player.html#getplayback" class="sidebar-link">GetPlayback</a></li><li><a href="/SpotifyAPI-NET/web/player.html#getplayingtrack" class="sidebar-link">GetPlayingTrack</a></li><li><a href="/SpotifyAPI-NET/web/player.html#transferplayback" class="sidebar-link">TransferPlayback</a></li><li><a href="/SpotifyAPI-NET/web/player.html#resumeplayback" class="sidebar-link">ResumePlayback</a></li><li><a href="/SpotifyAPI-NET/web/player.html#pauseplayback" class="sidebar-link">PausePlayback</a></li><li><a href="/SpotifyAPI-NET/web/player.html#skipplaybacktonext" class="sidebar-link">SkipPlaybackToNext</a></li><li><a href="/SpotifyAPI-NET/web/player.html#skipplaybacktoprevious" class="sidebar-link">SkipPlaybackToPrevious</a></li><li><a href="/SpotifyAPI-NET/web/player.html#seekplayback" class="sidebar-link">SeekPlayback</a></li><li><a href="/SpotifyAPI-NET/web/player.html#setrepeatmode" class="sidebar-link">SetRepeatMode</a></li><li><a href="/SpotifyAPI-NET/web/player.html#setvolume" class="sidebar-link">SetVolume</a></li><li><a href="/SpotifyAPI-NET/web/player.html#setshuffle" class="sidebar-link">SetShuffle</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="player"><a href="#player" aria-hidden="true" class="header-anchor">#</a> Player</h1> <h2 id="getdevices"><a href="#getdevices" aria-hidden="true" class="header-anchor">#</a> GetDevices</h2> <blockquote><p>Get information about a users available devices.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody></tbody></table> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">AvailabeDevices</span> devices <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">GetDevices</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
2019-08-16 23:41:36 +01:00
devices<span class="token punctuation">.</span>Devices<span class="token punctuation">.</span><span class="token function">ForEach</span><span class="token punctuation">(</span>device <span class="token operator">=&gt;</span> Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span>device<span class="token punctuation">.</span>Name<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><hr> <h2 id="getplayback"><a href="#getplayback" aria-hidden="true" class="header-anchor">#</a> GetPlayback</h2> <blockquote><p>Get information about the users current playback state, including track, track progress, and active device.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>[market]</td> <td>An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking.</td> <td><code>&quot;DE&quot;</code></td></tr></tbody></table> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">PlaybackContext</span> context <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">GetPlayback</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">if</span><span class="token punctuation">(</span>contex<span class="token punctuation">.</span>Item <span class="token operator">!=</span> <span class="token keyword">null</span><span class="token punctuation">)</span>
Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span>context<span class="token punctuation">.</span>Item<span class="token punctuation">.</span>Name<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">//Print the current song</span>
</code></pre></div><hr> <h2 id="getplayingtrack"><a href="#getplayingtrack" aria-hidden="true" class="header-anchor">#</a> GetPlayingTrack</h2> <blockquote><p>Get the object currently being played on the users Spotify account.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>[market]</td> <td>An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking.</td> <td><code>&quot;DE&quot;</code></td></tr></tbody></table> <p>This is a simpler (less data) version of <code>GetPlayback</code></p> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">PlaybackContext</span> context <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">GetPlayingTrack</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">if</span><span class="token punctuation">(</span>contex<span class="token punctuation">.</span>Item <span class="token operator">!=</span> <span class="token keyword">null</span><span class="token punctuation">)</span>
Console<span class="token punctuation">.</span><span class="token function">WriteLine</span><span class="token punctuation">(</span>context<span class="token punctuation">.</span>Item<span class="token punctuation">.</span>Name<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">//Print the current song</span>
</code></pre></div><hr> <h2 id="transferplayback"><a href="#transferplayback" aria-hidden="true" class="header-anchor">#</a> TransferPlayback</h2> <blockquote><p>Transfer playback to a new device and determine if it should start playing.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>deviceIds or deviceId</td> <td>A JSON array containing the ID of the device on which playback should be started/transferred</td> <td><code>&quot;XXXX-XXXX-XXXX-XXXX&quot;</code></td></tr> <tr><td>play</td> <td>true: ensure playback happens on new device, false: keep current playback state</td> <td><code>true</code></td></tr></tbody></table> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> error <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">TransferPlayback</span><span class="token punctuation">(</span><span class="token string">&quot;XXXX-XXXX-XXXX-XXXX&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><hr> <h2 id="resumeplayback"><a href="#resumeplayback" aria-hidden="true" class="header-anchor">#</a> ResumePlayback</h2> <blockquote><p>Start a new context or resume current playback on the users active device.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>[deviceId]</td> <td>The id of the device this command is targeting. If not supplied, the user's currently active device is the target.</td> <td><code>&quot;XXXX-XXXX-XXXX-XXXX&quot;</code></td></tr> <tr><td>contextUri</td> <td>Spotify URI of the context to play</td> <td><code>&quot;spotify:album:1Je1IMUlBXcx1Fz0WE7oPT&quot;</code></td></tr> <tr><td>uris</td> <td>An array of the Spotify track URIs to play.</td> <td><code>new List&lt;string&gt; { &quot;spotify:track:4iV5W9uYEdYUVa79Axb7Rh&quot; }</code></td></tr> <tr><td>offset</td> <td>Indicates from where in the context playback should start. Only available when context_uri corresponds to an album or playlist object, or when the uris parameter is used.</td> <td><code>0</code></td></tr></tbody></table> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> error <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">ResumePlayback</span><span class="token punctuation">(</span>uris<span class="token punctuation">:</span> <span class="token keyword">new</span> <span class="token class-name">List</span><span class="token operator">&lt;</span><span class="token keyword">string</span><span class="token operator">&gt;</span> <span class="token punctuation">{</span> <span class="token string">&quot;spotify:track:4iV5W9uYEdYUVa79Axb7Rh&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><hr> <h2 id="pauseplayback"><a href="#pauseplayback" aria-hidden="true" class="header-anchor">#</a> PausePlayback</h2> <blockquote><p>Pause playback on the users account.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>[deviceId]</td> <td>The id of the device this command is targeting. If not supplied, the user's currently active device is the target.</td> <td><code>&quot;XXXX-XXXX-XXXX-XXXX&quot;</code></td></tr></tbody></table> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> error <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">PausePlayback</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><hr> <h2 id="skipplaybacktonext"><a href="#skipplaybacktonext" aria-hidden="true" class="header-anchor">#</a> SkipPlaybackToNext</h2> <blockquote><p>Skips to next track in the users queue.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>[deviceId]</td> <td>The id of the device this command is targeting. If not supplied, the user's currently active device is the target.</td> <td><code>&quot;XXXX-XXXX-XXXX-XXXX&quot;</code></td></tr></tbody></table> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> error <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">SkipPlaybackToNext</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><hr> <h2 id="skipplaybacktoprevious"><a href="#skipplaybacktoprevious" aria-hidden="true" class="header-anchor">#</a> SkipPlaybackToPrevious</h2> <blockquote><p>Skips to previous track in the users queue.
Note that this will ALWAYS skip to the previous track, regardless of the current tracks progress.
Returning to the start of the current track should be performed using the https://api.spotify.com/v1/me/player/seek endpoint.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>[deviceId]</td> <td>The id of the device this command is targeting. If not supplied, the user's currently active device is the target.</td> <td><code>&quot;XXXX-XXXX-XXXX-XXXX&quot;</code></td></tr></tbody></table> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> error <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">SkipPlaybackToPrevious</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><hr> <h2 id="seekplayback"><a href="#seekplayback" aria-hidden="true" class="header-anchor">#</a> SeekPlayback</h2> <blockquote><p>Seeks to the given position in the users currently playing track.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>positionMs</td> <td>The position in milliseconds to seek to. Must be a positive number. Passing in a position that is greater than the length of the track will cause the player to start playing the next song.</td> <td><code>50</code></td></tr> <tr><td>[deviceId]</td> <td>The id of the device this command is targeting. If not supplied, the user's currently active device is the target.</td> <td><code>&quot;XXXX-XXXX-XXXX-XXXX&quot;</code></td></tr></tbody></table> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> error <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">SeekPlayback</span><span class="token punctuation">(</span><span class="token number">50</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><hr> <h2 id="setrepeatmode"><a href="#setrepeatmode" aria-hidden="true" class="header-anchor">#</a> SetRepeatMode</h2> <blockquote><p>Set the repeat mode for the users playback. Options are repeat-track, repeat-context, and off.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>state</td> <td>track, context or off.</td> <td><code>RepeatState.Track</code></td></tr> <tr><td>[deviceId]</td> <td>The id of the device this command is targeting. If not supplied, the user's currently active device is the target.</td> <td><code>&quot;XXXX-XXXX-XXXX-XXXX&quot;</code></td></tr></tbody></table> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> error <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">SetRepeatMode</span><span class="token punctuation">(</span>RepeatState<span class="token punctuation">.</span>Track<span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><hr> <h2 id="setvolume"><a href="#setvolume" aria-hidden="true" class="header-anchor">#</a> SetVolume</h2> <blockquote><p>Set the volume for the users current playback device.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>volumePercent</td> <td>Integer. The volume to set. Must be a value from 0 to 100 inclusive.</td> <td><code>50</code></td></tr> <tr><td>[deviceId]</td> <td>The id of the device this command is targeting. If not supplied, the user's currently active device is the target.</td> <td><code>&quot;XXXX-XXXX-XXXX-XXXX&quot;</code></td></tr></tbody></table> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> error <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">SetVolume</span><span class="token punctuation">(</span><span class="token number">50</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre></div><hr> <h2 id="setshuffle"><a href="#setshuffle" aria-hidden="true" class="header-anchor">#</a> SetShuffle</h2> <blockquote><p>Toggle shuffle on or off for users playback.</p></blockquote> <p><strong>Parameters</strong></p> <table><thead><tr><th>Name</th> <th>Description</th> <th>Example</th></tr></thead> <tbody><tr><td>shuffle</td> <td>True or False</td> <td><code>false</code></td></tr> <tr><td>[deviceId]</td> <td>The id of the device this command is targeting. If not supplied, the user's currently active device is the target.</td> <td><code>&quot;XXXX-XXXX-XXXX-XXXX&quot;</code></td></tr></tbody></table> <p><strong>Usage</strong></p> <div class="language-csharp extra-class"><pre class="language-csharp"><code><span class="token class-name">ErrorResponse</span> error <span class="token operator">=</span> _spotify<span class="token punctuation">.</span><span class="token function">SetShuffle</span><span class="token punctuation">(</span><span class="token keyword">false</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
2019-10-21 09:40:43 +01:00
</code></pre></div></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/web/player.md" target="_blank" rel="noopener noreferrer">Help us improve this page!</a> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></div> <div class="last-updated"><span class="prefix">Last Updated: </span> <span class="time">10/21/2019, 8:39:03 AM</span></div></footer> <!----> </main></div><div class="global-ui"></div></div>
<script src="/SpotifyAPI-NET/assets/js/app.b3b376a4.js" defer></script><script src="/SpotifyAPI-NET/assets/js/2.db6f1a12.js" defer></script><script src="/SpotifyAPI-NET/assets/js/19.c6343cc0.js" defer></script>
2019-08-16 23:41:36 +01:00
</body>
</html>