Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-sound-manager

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-sound-manager

React Native Sound Manager

  • 1.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Native Sound Manager

npm version

This package help you easy to control audio with support cache url!

This package requires these, please make sure you had installed them:

Getting started

$ npm install react-native-sound-manager --save

  • OR

$ yarn add react-native-sound-manager

  • All in one

$ npm install react-native-sound-manager react-native-sound react-native-fs --save

Usage

import SoundManager from 'react-native-sound-manager';

// Pre-download url - should call download before you want to play
/*
params: {
	background, // Boolean - Download in background || Default is `true`
	url,
	onError = () => {},
	onMessage = () => {},
	onPercentChange = () => {},
	onDone = () => {}
}
*/
SoundManager.downloadMediaFile(params)

/*
type IParams = {
	url: String,
	loop: Boolean,
	type: "overlay" | "center" | "override",
	cache: Boolean, // enable this will be download and re-use that file || Default is true
};
*/
/*
 When you want to play another audio, just call `play` function again and pass `type` : "overlay" | "center" | "override"
 Example we have a audio A playing, you want to play audio B
overlay: A and B playing together
center: It will be pause A -> play B until B done -> continue A
override: Stop A -> play B
*/
SoundManager.play({
	url: 'https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3',
	loop: false,
	type: PLAY_SOUND_TYPE.OVERLAY,
	cache: true,
})



SoundManager.pause()

SoundManager.resume()

SoundManager.stop()

SoundManager.disable()

SoundManager.enable()

License

This module is MIT licensed


Keywords

FAQs

Package last updated on 15 Feb 2022

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