floatinghotpot / cordova-plugin-nativeaudio

The low latency audio plugin is designed to enable low latency and polyphonic audio from Cordova/PhoneGap applications, using a very simple and basic API.
MIT License
235 stars 288 forks source link

Sound is still on while silent switch on iOS #82

Open CLIDOapps opened 8 years ago

CLIDOapps commented 8 years ago

Hi,

this is a great awesome plugin!

There is a small issue on iOS.

The silent switch (on iPhone) has no functions. The sound is still on. Just the volume buttons are working.

Is there a Javascript callback to detect changes by the silent switch to handle it selfs?

I use the Intel XDK for buildings.

Best regards from Germany DJAB1978

PS: Sry for the bad English :)

Ajaxy commented 8 years ago

Anything here? Seems that this is the new bug, version 3.0.2 from npm is OK.

Ajaxy commented 8 years ago

Seems that https://github.com/floatinghotpot/cordova-plugin-nativeaudio/commit/c72e147427bf49e5978d36f14330e28575313971 is the issue

adekbadek commented 8 years ago

Same problem here. After installing version 3.0.2 the sounds are not playing at all though.

greneham commented 8 years ago

same problem here

greneham commented 8 years ago

using 3.0.2 does fix it for me, thanks @Ajaxy

greneham commented 8 years ago

...actually, 3.0.2 has a couple of issues such as looped sounds dont stop playing, also not all of my sounds can play anymore since i switched to this version

greneham commented 8 years ago

ok so this seems to fix it

Ajaxy commented 8 years ago

@adekbadek android or ios?

adekbadek commented 8 years ago

@Ajaxy iOS

Ajaxy commented 8 years ago

@adekbadek strange, works for me. Not on emulator though.

Ajaxy commented 8 years ago

Any update on this?

adrian-quince commented 8 years ago

Can we get an option to set the Audio Session Category instead of just having it default to AVAudioSessionCategoryPlayback? AVAudioSessionCategoryAmbient and AVAudioSessionCategorySoloAmbient would be useful as well.

pavei commented 7 years ago

Someone solved this problem?

Ajaxy commented 7 years ago

I use different versions for iOS and Android and it's annoying :( сб, 10 дек. 2016 г. в 0:42, pavei notifications@github.com:

Someone solved this problem?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/floatinghotpot/cordova-plugin-nativeaudio/issues/82#issuecomment-266131324, or mute the thread https://github.com/notifications/unsubscribe-auth/AAVzIQV9f2PJ4cDwk06Lqt2B3tqGTuRDks5rGcs7gaJpZM4IKa3O .

pavei commented 7 years ago

@Ajaxy which version are you using on iOS?

Ajaxy commented 7 years ago

3.0.3

pavei commented 7 years ago

Still not working on iOS 10 :(

geshub commented 7 years ago

Hi, i also need to find a way to stop sounds playing when silent switch on iOS ( plugin v3.0.7 ), Anyone found one ?

petewall commented 7 years ago

@geshub, I did the same steps that @greneham listed and now it's working for me on iOS 10.

geshub commented 7 years ago

Would it be possible to commit @greneham code to the plugin ?

msmfsd commented 7 years ago

@floatinghotpot Bump

MartinDomig commented 7 years ago

According to Apple API documentation, AVAudioSessionCategoryPlayback won't honor the silent switch. Replace it with AVAudioSessionCategoryAmbient, and the mute switch will do what you expect.

I've branched the plugin and it works for me. See https://github.com/MartinDomig/cordova-plugin-nativeaudio/commit/ba2e1240f41a825ba3e149d8da4f4aaa77499d8d

msmfsd commented 7 years ago

A HUGE thanks to @MartinDomig for this fork. I have tested it on iPhone 6 w iOS 10 and it fixes both the following issues:

Awesome work

geshub commented 7 years ago

Could we merge the changes to the plugin ?

MartinDomig commented 7 years ago

I've just created a pull request - there isn't much more I can do. The maintainer of this repository would have to accept it.

https://github.com/floatinghotpot/cordova-plugin-nativeaudio/pull/123

jvwelzen commented 7 years ago

I think you should use the option MixWithOthers otherwise the muisc is ducked but not restored to it's original volume when starting the app

jvwelzen commented 7 years ago

I am trying to get an extra function in so that you can change the catagory what you want the player and other players are going to do but still not no succes

btw This is the first Phonegap plugin that I am working on

Ajaxy commented 7 years ago

Any update on this?

Ovilia commented 5 years ago

Any update on this?