# plae

> Easy to use JS library for playing music and such

Latest version **0.1.1** (published 2015-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install plae
pnpm add plae
yarn add plae
bun add plae
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2015-11-07 |
| First published | 2015-11-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Known vulnerabilities | 0 (+5 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Johnny Ray Austin |
| Maintainers | johnnyray |

## Links

- npm: https://www.npmjs.com/package/plae
- Repository: https://github.com/jray/plae
- Issues: https://github.com/jray/plae/issues
- npm.io page: https://npm.io/package/plae

## Dependencies (9)

- [jade](https://npm.io/package/jade.md) ^0.28.2
- [lazy](https://npm.io/package/lazy.md) ^1.0.8
- [tako](https://npm.io/package/tako.md) ^0.3.0
- [jquery](https://npm.io/package/jquery.md) ^1.8.3
- [request](https://npm.io/package/request.md) ^2.10.0
- [cli-color](https://npm.io/package/cli-color.md) ^0.1.6
- [uglify-js](https://npm.io/package/uglify-js.md) ^2.3.2
- [gulp-concat](https://npm.io/package/gulp-concat.md) ^2.3.4
- [node-minify](https://npm.io/package/node-minify.md) ^0.7.3

## Recent versions

- 0.1.1 (latest) — 2015-11-07

## README

### Basic Usage
```javascript

  // swagg player specific code starts here
  var player = Plae().init({
    url: '/swf',
    songs: [
      {
        url: 'sound/the-good-life.mp3',
        artist: 'Nancy Wilson',
        title: 'The Good Life',
        art: 'img/nancywilson.jpg'
      }
    ]
  })
  .onReady(function(){
    this.play();
  });

```

### SoundManager2 Dependency
SoundManager2 comes packaged. If you want flash fallback, you'll need to have the soundManager2.swf
file publicly available. If you place it anywhere other than the /swf folder, then configure that location
via the url parameter.

### Params

| **Param**     | **Type**         | **default**     | **Description** |
| :------------ | :--------------  | :-------------- | :-------------- |
| songs         | Array            | n/a            | Song configuration |
| whilePlaying  | function         | null           | Fires at a regular interval while a sound is playing |
| onStop        | function         | null           | Fires when the music is stopeed |
| onPlay        | function         | null           | Fires when a song starts playing |
| onPause       | function         | null           | Fires when a song is paused |
| onResume      | function         | null           | Fires when a song is resumed after a pause |
| url           | string           | '/swf'         | Location of your swf files for soundManager2

### Methods
| **Method**    | **Description** | **Parameters** | **Returns**
| :------------ | :--------------  | :-------------- | :-------------- |
| stop()        | Stops the music  | n/a            | n/a
| play()        | Plays music      | Index of the track to play (default 0) | n/a
| pause()       | Pauses music     | n/a | n/a
| next()        | Plays the next track | n/a | n/a
| prev()        | Plays the previous track | n/a | n/a
| cursor()      | Makes the current the specified one without actually playing the track | Index of the target track | The track metadata (artist, title, art)

See a working demo at http://jray.github.io/plae

The code for the demo is in the web/ folder

---
_Source: https://npm.io/package/plae · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
