Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
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

License

Cordova PhoneCall Trap is released under the MIT License.

Keywords

FAQs

Package last updated on 12 Nov 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc