# cordova-plugin-audio-interruption

> AudioInterruption plugin

Latest version **0.1.3** (published 2017-12-14) · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-audio-interruption
pnpm add cordova-plugin-audio-interruption
yarn add cordova-plugin-audio-interruption
bun add cordova-plugin-audio-interruption
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2017-12-14 |
| First published | 2017-11-12 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | wingood |
| Keywords | ecosystem:cordova, cordova-android, cordova-ios, cordova |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-audio-interruption
- Repository: https://github.com/WinGood/cordova-plugin-audio-interruption
- Homepage: https://github.com/WinGood/cordova-plugin-audio-interruption#readme
- Issues: https://github.com/WinGood/cordova-plugin-audio-interruption/issues
- npm.io page: https://npm.io/package/cordova-plugin-audio-interruption

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2017-12-14
- 0.1.1 — 2017-11-12
- 0.1.0 — 2017-11-12
- 0.0.4 — 2017-11-12
- 0.0.3 — 2017-11-12
- 0.0.2 — 2017-11-12
- 0.0.1 — 2017-11-12

## README

Cordova Audio Interruption
=======================

It's a simple Apache Cordova plugin to simplify handling audio interruptions in iOS and Android devices, 
this plugin will be useful if you want to resume audio in your application after phone call or any other audio interruption in the os.


## Install
```
$ cordova plugin add cordova-plugin-audio-interruption
```

## Quick Example
```javascript
let playingWasInterrupted = false;
let audio = new Audio();

AudioInterruption.addListener(status => {
    switch (status) {
        case 'INTERRUPTION_BEGIN':
            if (!audio.paused) {
                playingWasInterrupted = true;
                audio.pause();
            } 
            break;
        case 'INTERRUPTION_ENDED':
            if (playingWasInterrupted) {
              playingWasInterrupted = false;
              audio.play();
            }
            break;
    }
});
```

## Supported platforms

- Android 2.3.3 or higher
- iOS 9.0 or higher

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