cordova-spotify
Advanced tools
Comparing version 0.5.4 to 0.5.5
{ | ||
"name": "cordova-spotify", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"description": "Spotify SDK bindings for Cordova Applications", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -21,4 +21,30 @@ # Cordova Spotify SDK Plugin | ||
## Examples | ||
The plugin is very simple to use. All methods can be called at any time and there is no initialization step. The plugin performs all necessary state changes automatically. All methods documented in the API documentation are exported under the global `cordova.plugins.spotify`-object. | ||
### Play some good music | ||
```js | ||
cordova.plugins.spotify.play("spotify:track:0It6VJoMAare1zdV2wxqZq", { | ||
clientId: "<YOUR SPOTIFY CLIENT ID", | ||
token: "<YOUR VALID SPOTIFY ACCESS TOKEN WITH STREAMING SCOPE>" | ||
}) | ||
.then(() => console.log("Music is playing 🎶")); | ||
``` | ||
### React to user pressing pause button | ||
```js | ||
cordova.plugins.spotify.pause() | ||
.then(() => console.log("Music is paused ⏸")); | ||
``` | ||
### Display current playing position | ||
```js | ||
cordova.plugins.spotify.getPosition() | ||
.then(pos => console.log(`We're currently ${pos}ms into the track.`)) | ||
.catch(() => console.log("Whoops, no track is playing right now.")); | ||
``` | ||
## Contributing | ||
Pull requests are very welcome! Please use the [gitmoji](https://gitmoji.carloscuesta.me/) style for commit messages. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
50
0
312841
31