zmxv / react-native-sound

React Native module for playing sound clips
MIT License
2.79k stars 747 forks source link

getSystemVolume should be static #667

Open alexsegura opened 4 years ago

alexsegura commented 4 years ago

:clipboard: Description

The getSystemVolume should not be bound to an instance Sound, but should be accessible statically.

Like this:

import Sound from 'react-native-sound'
Sound.getSystemVolume(volume => console.log(volume))

:bulb: Alternatives

You can do this, but it's not ideal

import { NativeModules } from 'react-native'
NativeModules.RNSound.getSystemVolume(volume => console.log(volume))

If you think it makes sense, I can create a pull request for this 🙂

fawaz-ahmed-toptal commented 4 years ago

iOS => getSystemVolume keeps on returning 0, once it reaches 0