forked from makeratplay/SpotifyWebAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
83 lines (70 loc) · 4.3 KB
/
index.html
File metadata and controls
83 lines (70 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Spotify Web API Demo</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<link href="style.css" rel="stylesheet">
<script src="app.js"></script>
</head>
<body onload="onPageLoad()">
<div class="container">
<div id="tokenSection" class="row">
<div class="col">
<p class="welcomeText">This is a javascript app that shows how to use the Spotify API to control the playback
of music (playlist or albums) on any of your devices connected to your spotify account.</p>
<p class="welcomeText">To use this app you need a Spotify client ID and client secret. You get these by
creating an app in the Spotify developers dashboard here
<a href="https://developer.spotify.com/dashboard/applications" target="_blank">https://developer.spotify.com/dashboard/applications</a>
and add https://makeratplay.github.io/SpotifyWebAPI/ in the "Redirect URIs" settings field.
</p>
<p class="welcomeText">
This app demostrates how the use the following APIs:
<ul>
<li>https://accounts.spotify.com/authorize </li>
<li>https://accounts.spotify.com/api/token </li>
<li>https://api.spotify.com/v1/me/playlists </li>
<li>https://api.spotify.com/v1/me/player/devices </li>
<li>https://api.spotify.com/v1/me/player/play </li>
<li>https://api.spotify.com/v1/me/player/pause </li>
<li>https://api.spotify.com/v1/me/player/next </li>
<li>https://api.spotify.com/v1/me/player/previous </li>
<li>https://api.spotify.com/v1/me/player </li>
<li>https://api.spotify.com/v1/playlists/{{PlaylistId}}/tracks </li>
<li>https://api.spotify.com/v1/me/player/currently-playing </li>
<li>https://api.spotify.com/v1/me/player/shuffle </li>
</ul>
</p>
</div>
<div class="col">
<div class="mb-3">
<label for="clientId" class="form-label">Client ID</label>
<input type="text" class="form-control" id="clientId" placeholder="">
</div>
<div class="mb-3">
<label for="clientSecret" class="form-label">Client Secret</label>
<input type="text" class="form-control" id="clientSecret" placeholder="">
</div>
<input class="btn btn-primary btn-lg" type="button" onclick="requestAuthorization()" value="Request Authorization"><br/>
</div>
<div class="col">
<p class="welcomeText" style="margin-top: 40px;"> I used this project to learn the Spotify API in order to create this project:</p>
<iframe width="560" height="315" src="https://www.youtube.com/embed/H2HJ-LY7-lQ" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
<div class="mb-3">
<label for="playlists" class="form-label">Playlists</label>
<table id="playlists" class="form-control">
</table>
<table id="followers" class="form-control">
</table>
<input class="btn btn-primary btn-sm mt-3" type="button" onclick="refreshPlaylists()" value="Refresh Playlists">
<input class="btn btn-primary btn-sm mt-3" type="button" onclick="refreshPlaylists()" value="Refresh Playlists">
</div>
</div>
</div>
</div>
</div>
</body>
</html>