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
@@ -29,7 +29,7 @@ supporting Kotlin/JS, Kotlin/Android, Kotlin/JVM, and Kotlin/Native
29
29
+[SpotifyApiBuilder block & setting API options](#spotifyapibuilder-block--setting-api-options)
30
30
*[API options](#api-options)
31
31
+[Using the API](#using-the-api)
32
-
*[Platform-specific wrappers and information]("#platform-specific-wrappers-and-information")
32
+
*[Platform-specific wrappers and information](#platform-specific-wrappers-and-information)
33
33
+[JavaScript: Spotify Web Playback SDK wrapper](#js-spotify-web-playback-sdk-wrapper)
34
34
*[Tips](#tips)
35
35
+[Building the API](#building-the-api)
@@ -384,11 +384,46 @@ for playing music via Spotify in the browser on your own site.
384
384
To do this, you need to create a `Player` instance and then use the associated methods to register listeners, play,
385
385
and get current context.
386
386
387
-
**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)**.
387
+
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
388
An example project, [spotify-web-api-browser-example](https://github.com/adamint/spotify-web-api-browser-example),
389
389
demonstrates how to create a frontend JS Kotlin application with Spotify integration and
390
390
that will play music in the browser.
391
391
392
+
**Notes**:
393
+
1. You must include the Spotify player JS script by including `<script src="https://sdk.scdn.co/spotify-player.js"></script>`
394
+
2. You must define a `window.onSpotifyWebPlaybackSDKReady` function immediately afterwards - this should load your main application bundle.
395
+
Otherwise, you will get errors. An example is below:
0 commit comments