Socket
Book a DemoInstallSign in
Socket

cordova-plugin-audio-interruption

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-audio-interruption

AudioInterruption plugin

0.1.3
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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

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

Keywords

ecosystem:cordova

FAQs

Package last updated on 14 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.