Spotify.NET/SpotifyWebAPI/player/index.html

564 lines
16 KiB
HTML
Raw Normal View History

2017-05-31 17:11:44 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="JohnnyCrazy">
<link rel="shortcut icon" href="../../img/favicon.ico">
<title>- Player - SpotifyAPI-NET</title>
<link href="../../css/bootstrap-custom.min.css" rel="stylesheet">
<link href="../../css/font-awesome-4.0.3.css" rel="stylesheet">
<link href="../../css/prettify-1.0.css" rel="stylesheet">
<link href="../../css/base.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/styles/agate.min.css">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<!-- Collapsed navigation -->
<div class="navbar-header">
<!-- Expander button -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Main title -->
<a class="navbar-brand" href="../..">SpotifyAPI-NET</a>
</div>
<!-- Expanded navigation -->
<div class="navbar-collapse collapse">
<!-- Main navigation -->
<ul class="nav navbar-nav">
<li >
<a href="../..">Home</a>
</li>
<li class="dropdown active">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">SpotifyWebAPI <b class="caret"></b></a>
<ul class="dropdown-menu">
<li >
<a href="../gettingstarted/">Getting started</a>
</li>
<li >
<a href="../examples/">Examples</a>
</li>
<li >
<a href="../auth/">Authentication</a>
</li>
<li >
<a href="../albums/">- Albums</a>
</li>
<li >
<a href="../artists/">- Artists</a>
</li>
<li >
<a href="../browse/">- Browse</a>
</li>
<li >
<a href="../follow/">- Follow</a>
</li>
<li >
<a href="../library/">- Library</a>
</li>
<li class="active">
<a href="./">- Player</a>
</li>
<li >
<a href="../playlists/">- Playlists</a>
</li>
<li >
<a href="../profiles/">- Profiles</a>
</li>
<li >
<a href="../search/">- Search</a>
</li>
<li >
<a href="../tracks/">- Tracks</a>
</li>
<li >
<a href="../util/">- Util</a>
</li>
</ul>
</li>
<li >
<a href="../../SpotifyLocalAPI/">SpotifyLocalAPI</a>
</li>
</ul>
<!-- Search, Navigation and Repo links -->
<ul class="nav navbar-nav navbar-right">
<li >
<a rel="next" href="../library/">
<i class="fa fa-arrow-left"></i> Previous
</a>
</li>
<li >
<a rel="prev" href="../playlists/">
Next <i class="fa fa-arrow-right"></i>
</a>
</li>
<li>
<a href="https://github.com/JohnnyCrazy/SpotifyAPI-NET">
<i class="fa fa-github"></i>
GitHub
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary" style="height=90%;">
<ul class="nav bs-sidenav">
<li class="main active"><a href="#getdevices">GetDevices</a></li>
<li class="main "><a href="#getplayback">GetPlayback</a></li>
<li class="main "><a href="#getplayingtrack">GetPlayingTrack</a></li>
<li class="main "><a href="#transferplayback">TransferPlayback</a></li>
<li class="main "><a href="#resumeplayback">ResumePlayback</a></li>
<li class="main "><a href="#pauseplayback">PausePlayback</a></li>
<li class="main "><a href="#skipplaybacktonext">SkipPlaybackToNext</a></li>
<li class="main "><a href="#skipplaybacktoprevious">SkipPlaybackToPrevious</a></li>
<li class="main "><a href="#seekplayback">SeekPlayback</a></li>
<li class="main "><a href="#setrepeatmode">SetRepeatMode</a></li>
<li class="main "><a href="#setvolume">SetVolume</a></li>
<li class="main "><a href="#setshuffle">SetShuffle</a></li>
</ul>
</div></div>
<div class="col-md-9" role="main">
<h2 id="getdevices">GetDevices</h2>
<blockquote>
<p>Get information about a users available devices.</p>
</blockquote>
<p><strong>Paramters</strong> </p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Example</th>
</tr>
</thead>
<tbody></tbody>
</table>
<p><strong>Usage</strong> </p>
<pre><code class="cs">AvailabeDevices devices = _spotify.GetDevices();
devices.Devices.ForEach(device =&gt; Console.WriteLine(device.Name));
</code></pre>
<hr />
<h2 id="getplayback">GetPlayback</h2>
<blockquote>
<p>Get information about the users current playback state, including track, track progress, and active device.</p>
</blockquote>
<p><strong>Paramters</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>"DE"</code></td>
</tr>
</tbody>
</table>
<p><strong>Usage</strong> </p>
<pre><code class="cs">PlaybackContext context = _spotify.GetPlayback();
if(contex.Item != null)
Console.WriteLine(context.Item.Name)); //Print the current song
</code></pre>
<hr />
<h2 id="getplayingtrack">GetPlayingTrack</h2>
<blockquote>
<p>Get the object currently being played on the users Spotify account.</p>
</blockquote>
<p><strong>Paramters</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>"DE"</code></td>
</tr>
</tbody>
</table>
<p>This is a simpler (less data) version of <code>GetPlayback</code></p>
<p><strong>Usage</strong> </p>
<pre><code class="cs">PlaybackContext context = _spotify.GetPlayingTrack();
if(contex.Item != null)
Console.WriteLine(context.Item.Name)); //Print the current song
</code></pre>
<hr />
<h2 id="transferplayback">TransferPlayback</h2>
<blockquote>
<p>Transfer playback to a new device and determine if it should start playing.</p>
</blockquote>
<p><strong>Paramters</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>"XXXX-XXXX-XXXX-XXXX"</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>
<pre><code class="cs">ErrorResponse error = _spotify.TransferPlayback(&quot;XXXX-XXXX-XXXX-XXXX&quot;);
</code></pre>
<hr />
<h2 id="resumeplayback">ResumePlayback</h2>
<blockquote>
<p>Start a new context or resume current playback on the users active device.</p>
</blockquote>
<p><strong>Paramters</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>"XXXX-XXXX-XXXX-XXXX"</code></td>
</tr>
<tr>
<td>contextUri</td>
<td>Spotify URI of the context to play</td>
<td><code>"spotify:album:1Je1IMUlBXcx1Fz0WE7oPT"</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; { "spotify:track:4iV5W9uYEdYUVa79Axb7Rh" }</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>
<pre><code class="cs">ErrorResponse error = _spotify.ResumePlayback(uris: new List&lt;string&gt; { &quot;spotify:track:4iV5W9uYEdYUVa79Axb7Rh&quot; });
</code></pre>
<hr />
<h2 id="pauseplayback">PausePlayback</h2>
<blockquote>
<p>Pause playback on the users account.</p>
</blockquote>
<p><strong>Paramters</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>"XXXX-XXXX-XXXX-XXXX"</code></td>
</tr>
</tbody>
</table>
<p><strong>Usage</strong> </p>
<pre><code class="cs">ErrorResponse error = _spotify.PausePlayback();
</code></pre>
<hr />
<h2 id="skipplaybacktonext">SkipPlaybackToNext</h2>
<blockquote>
<p>Skips to next track in the users queue.</p>
</blockquote>
<p><strong>Paramters</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>"XXXX-XXXX-XXXX-XXXX"</code></td>
</tr>
</tbody>
</table>
<p><strong>Usage</strong> </p>
<pre><code class="cs">ErrorResponse error = _spotify.SkipPlaybackToNext();
</code></pre>
<hr />
<h2 id="skipplaybacktoprevious">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>Paramters</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>"XXXX-XXXX-XXXX-XXXX"</code></td>
</tr>
</tbody>
</table>
<p><strong>Usage</strong> </p>
<pre><code class="cs">ErrorResponse error = _spotify.SkipPlaybackToPrevious();
</code></pre>
<hr />
<h2 id="seekplayback">SeekPlayback</h2>
<blockquote>
<p>Seeks to the given position in the users currently playing track.</p>
</blockquote>
<p><strong>Paramters</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>"XXXX-XXXX-XXXX-XXXX"</code></td>
</tr>
</tbody>
</table>
<p><strong>Usage</strong> </p>
<pre><code class="cs">ErrorResponse error = _spotify.SeekPlayback(50);
</code></pre>
<hr />
<h2 id="setrepeatmode">SetRepeatMode</h2>
<blockquote>
<p>Set the repeat mode for the users playback. Options are repeat-track, repeat-context, and off.</p>
</blockquote>
<p><strong>Paramters</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>"XXXX-XXXX-XXXX-XXXX"</code></td>
</tr>
</tbody>
</table>
<p><strong>Usage</strong> </p>
<pre><code class="cs">ErrorResponse error = _spotify.SetRepeatMode(RepeatState.Track);
</code></pre>
<hr />
<h2 id="setvolume">SetVolume</h2>
<blockquote>
<p>Set the volume for the users current playback device.</p>
</blockquote>
<p><strong>Paramters</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>"XXXX-XXXX-XXXX-XXXX"</code></td>
</tr>
</tbody>
</table>
<p><strong>Usage</strong> </p>
<pre><code class="cs">ErrorResponse error = _spotify.SetVolume(50);
</code></pre>
<hr />
<h2 id="setshuffle">SetShuffle</h2>
<blockquote>
<p>Toggle shuffle on or off for users playback.</p>
</blockquote>
<p><strong>Paramters</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>"XXXX-XXXX-XXXX-XXXX"</code></td>
</tr>
</tbody>
</table>
<p><strong>Usage</strong> </p>
<pre><code class="cs">ErrorResponse error = _spotify.SetShuffle(false);
</code></pre></div>
</div>
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="../../js/bootstrap-3.0.3.min.js"></script>
<script src="../../js/base.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script>
<script src="../../highlight.js"></script>
</body>
</html>