You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-2Lines changed: 37 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ supporting Kotlin/JS, Kotlin/Android, Kotlin/JVM, and Kotlin/Native
30
30
+[SpotifyApiBuilder block & setting API options](#spotifyapibuilder-block--setting-api-options)
31
31
*[API options](#api-options)
32
32
+[Using the API](#using-the-api)
33
-
*[Platform-specific wrappers and information]("#platform-specific-wrappers-and-information")
33
+
*[Platform-specific wrappers and information](#platform-specific-wrappers-and-information)
34
34
+[JavaScript: Spotify Web Playback SDK wrapper](#js-spotify-web-playback-sdk-wrapper)
35
35
*[Tips](#tips)
36
36
+[Building the API](#building-the-api)
@@ -385,11 +385,46 @@ for playing music via Spotify in the browser on your own site.
385
385
To do this, you need to create a `Player` instance and then use the associated methods to register listeners, play,
386
386
and get current context.
387
387
388
-
**Please see an example of how to do this [here](https://github.com/adamint/spotify-web-api-browser-example/blob/95df60810611ddb961a7a2cb0c874a76d4471aa7/src/main/kotlin/com/adamratzman/layouts/HomePageComponent.kt#L38)**.
388
+
Please see an example of how to do this [here](https://github.com/adamint/spotify-web-api-browser-example/blob/95df60810611ddb961a7a2cb0c874a76d4471aa7/src/main/kotlin/com/adamratzman/layouts/HomePageComponent.kt#L38).
389
389
An example project, [spotify-web-api-browser-example](https://github.com/adamint/spotify-web-api-browser-example),
390
390
demonstrates how to create a frontend JS Kotlin application with Spotify integration and
391
391
that will play music in the browser.
392
392
393
+
**Notes**:
394
+
1. You must include the Spotify player JS script by including `<script src="https://sdk.scdn.co/spotify-player.js"></script>`
395
+
2. You must define a `window.onSpotifyWebPlaybackSDKReady` function immediately afterwards - this should load your main application bundle.
396
+
Otherwise, you will get errors. An example is below:
0 commit comments