# sine-audio-player

> Music & Audio Player JavaScript Library

Latest version **1.0.0** (published 2021-11-29) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install sine-audio-player
pnpm add sine-audio-player
yarn add sine-audio-player
bun add sine-audio-player
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-11-29 |
| First published | 2021-11-29 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tharun |
| Maintainers | tharunbirla |
| Keywords | web-audio, web-audio-library, audio-library, javascript, music-player, ui-audio |

## Links

- npm: https://www.npmjs.com/package/sine-audio-player
- Repository: https://github.com/tharunbirla/sine-audio-player
- Homepage: https://github.com/tharunbirla/sine-audio-player#readme
- Issues: https://github.com/tharunbirla/sine-audio-player/issues
- npm.io page: https://npm.io/package/sine-audio-player

## Recent versions

- 1.0.0 (latest) — 2021-11-29

## README

��# Sine Audio Player

![GitHub](https://img.shields.io/github/license/tharunbirla/sine-audio-player)
![GitHub file size in bytes](https://img.shields.io/github/size/tharunbirla/sine-audio-player/dist/sine-audio-player.min.js)
![GitHub last commit](https://img.shields.io/github/last-commit/tharunbirla/sine-audio-player)

## [Online demo](https://tharunbirla.github.io/sine-audio-player/)

![Sine Audio Player](https://i.imgur.com/tnPLsRB.png)

## Installation

#### Github

Download repository [ZIP](https://codeload.github.com/tharunbirla/sine-audio-player/zip/main).

#### CDN

Alternatively, you can load it from CDN:

```html
<script src="https://cdn.jsdelivr.net/gh/tharunbirla/sine-audio-player/dist/sine-audio-player.min.js"></script>
```
## Usage

Include the `sine-audio-player.min.js` file:

```html
<script src="{path}/dist/sine-audio-player.min.js"></script>
```

Add `<sine-player>` tag between your HTML `<body></body>` tag. You add the attributes mentioned bellow in the table.

```html
<sine-player src="your-audio.mp3"></sine-player>
```

You can add multiple players on a single page.

## Options
| Option | Description | Values | Default |
|--------|-------------|--------|---------|
| src | Specifies the URL of the audio file. | `URL` | `-`
| muted | Specifies that the audio output should be muted. | `true`, `false` | `false`
| preload | Specifies if and how the author thinks the audio should be loaded when the page loads. | `none`,`auto`,`metadata` | `false`
| autoplay | Specifies that the audio will start playing as soon as it is ready. | `autoplay` | `false`
| buffer-percentage | Specifies how much audio data must be rendered as soon as the user load the page | `number` | `50`

_Other default options:_ 
| Options | Default |
|---------|---------|
| Volume | 100% |
| Preview Volume | 50% |


You can focus on player elements with Tab key and use the following keys to use the player controls.

| Key | Action |
|--------|-------------|
| Tab | Focus on the next element | 
| Shift + Tab | Focus on the previous element | 
| Enter or Spacebar | Pause/Play | 
| Right Arrow | Fast-forward | 
| Left Arrow | Rewind | 
| Enter or Spacebar | Show/hide volume slider |
| Up Arrow, Left Arrow | Increase volume |
| Down Arrow, Right Arrow | Decrease volume |

[Video](https://www.youtube.com/rkqqBA6ohc0)

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