Lineup Signup
Hi! We're just rearranging some Desktop boards to make it easier to find what you're looking for. Please bear with us, and we'll be done very soon.
To post a new question or issue, please go here: Desktop (Windows), Desktop (Mac), Desktop (Linux), Web Player.

Adless Spotify With Webplayer SDK

Reply

Adless Spotify With Webplayer SDK

user-removed
Not applicable

Plan

Free/Premium

Country

Turkey

 

Operating System

Windows 10

 

While Playing With Spotify Webplayer SDK realize something and that is the Webplayer SDK removes ads and even makes musics seekable and actually I liked it. First I decide to use it, but after I think thats not true and so thats why Am I reporting It. Also I add a video as a proof. Here is the html code

<!DOCTYPE html> <html><body> <h1>Adless Spotify Player</h1> <input id="token" type="text" placeholder="Spotify Token"> <small id="status">Status: Waiting</small><br> <small>If You Don't Have One You Can Get One <a href="https://developer.spotify.com/documentation/web-playback-sdk/quick-start/#authenticating-with-spotif..." target="_blank">Here</a></small><br> <button type="button" onclick="connect()" id="connectBtn" disabled>Connect Spotify</button><br><br> <p id="np"></p> <button type="button" onclick="player.previousTrack()" id="previousBtn" disabled>Previous Track</button> <button type="button" onclick="player.togglePlay()" id="toggleBtn" disabled>Toogle Play</button> <button type="button" onclick="player.nextTrack()" id="nextBtn" disabled>Next Track</button> <script src="https://sdk.scdn.co/spotify-player.js"></script> <script> var player; window.onSpotifyWebPlaybackSDKReady = () => { document.getElementById("connectBtn").disabled = false; }; function connect() { const token = document.getElementById("token").value; player = new Spotify.Player({ name: 'Adless Spotify Player', getOAuthToken: cb => { cb(token); } }); player.addListener('authentication_error', ({ message }) => { document.getElementById("status").innerHTML = "Status: Wrong Authentication Token!"; }); player.addListener('player_state_changed', (object) => { if (object){ document.getElementById("status").innerHTML = "Status: Ready To Play!"; document.getElementById("previousBtn").disabled = false; document.getElementById("nextBtn").disabled = false; document.getElementById("toggleBtn").disabled = false; document.getElementById("np").innerHTML = "Now Playing: <strong>" + object.track_window.current_track.name + "</strong>"; } else{ document.getElementById("status").innerHTML = "Status: Ready! Go To Spotify And Change Playing Device Into 'Adless Spotify Player' To Start Listening"; document.getElementById("np").innerHTML = ""; document.getElementById("previousBtn").disabled = true; document.getElementById("nextBtn").disabled = true; document.getElementById("toggleBtn").disabled = true; } }); // Ready player.addListener('ready', ({ device_id }) => { document.getElementById("status").innerHTML = "Status: Ready! Go To Spotify And Change Playing Device Into 'Adless Spotify Player' To Start Listening"; document.getElementById("connectBtn").innerHTML = "Connected"; document.getElementById("connectBtn").disabled = true; }); player.connect(); } </script> </body> </html>

SUGGESTED POSTS