0

The thing is... Spotify doesn't seem to create an audio or video element to play these tracks so I can change the playback rate from the element reference, it creates an <iframe> element instead:

<iframe src="https://sdk.scdn.co/embedded/index.html" alt="Audio Playback Container" allow="encrypted-media; autoplay">
 <html>
  <head>
   <meta charset="UTF-8">
   <title>Spotify Embedded Player</title>
  </head>
  <body>
   <script src="index.js"></script>
  </body>
 </html>
</iframe>

The script source is: https://sdk.scdn.co/embedded/index.js

Is the 'allow="encrypted-media"' telling me something?

I know this is possible on the official Spotify website, because a video or audio element is created, but since I'm using the Spotify Web Playback SDK, I can't do that.

  • Are you referring to the open/embedded player? I don't see an iframe in this sample 5+ hour audio (maybe they've changed things). https://open.spotify.com/embed-podcast/episode/4N8VtcWq3A2FSCiFrexzHl Though I still can't find any object to apply/update the playbackRate. Can you provide an example (url) where Spotify changes the playback speed? – CPG Feb 26 '23 at 16:46
  • Totally forgot those embedded players existed, my bad, I was talking about the Web Playback SDK: https://developer.spotify.com/documentation/web-playback-sdk/ If you get this on your own website, it creates an iframe. Search for any Spotify Playback Speed browser extension. That's the way I know it can be changed. – TXRBOMVNE Mar 01 '23 at 20:13
  • I can only suspect that Spotify is using [HTMLAudioElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement) or [WebAudioAPI](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API) without an HTML element. [This question](https://stackoverflow.com/questions/57391854/how-to-set-playbackrate-of-htmlaudioelement-in-combination-with-a-sourcenode-and), or [this one](https://stackoverflow.com/questions/48677424/how-can-i-dynamically-change-playback-rate-in-web-audio-api) may give you clues, but my attempts at modifying the Spotify playbackRate were unsuccessful. – CPG Mar 02 '23 at 14:06

0 Answers0