Skip to content

Commit

Permalink
🔀 Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoLegends committed Nov 4, 2017
2 parents 65def3a + e360759 commit f1f975a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ deploy:
- provider: npm
email: $NPM_DPL_EMAIL
api_key: $NPM_DPL_TOKEN
skip_cleanup: true
tag: next
on:
tags: true
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,32 @@ cordova plugin add cordova-spotify

Note: Make sure your installation path doesn't contain any spaces.

## 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.

0 comments on commit f1f975a

Please sign in to comment.