adrianstevens / Xamarin-Plugins

Cross-platform Plugins for Xamarin, Xamarin.Forms and Windows
https://www.nuget.org/packages/Xam.Plugin.SimpleAudioPlayer/
MIT License
132 stars 53 forks source link

iOS: Hardware silencing switch mutes playback #22

Open BioTurboNick opened 6 years ago

BioTurboNick commented 6 years ago

The hardware silencing switch mutes playback from your player on iOS devices. It appears there is a way to override this behavior in an app: https://stackoverflow.com/questions/10322040/how-to-play-a-sound-using-avaudioplayer-when-in-silent-mode-in-iPhone

Please consider making this mode the default, and/or highlight it in the documentation.

adrianstevens commented 6 years ago

Let me investigate further - I'm sure we can make this a configurable option

Osmosis311 commented 5 years ago

Hi. Just wanted to +1 this feature. Would be INCREDIBLY helpful in my app for EMS personnel to prompt for CPR without needing to remember to unmute their phones. Thanks!

https://stackoverflow.com/questions/35289918/play-audio-when-device-in-silent-mode-ios-swift

ChetCromer commented 5 years ago

+1 this as well. We are gradually replacing platform-specific players with this and we've noticed it won't play back when the phone is in silent / vibrate.

The plugin also stops playback when you leave the app or the phone locks itself.

I think that Osmosis311's link is in the right direction - setting the category of audio will also help with playback when other sound events occur in other apps (i'm building a podcast app and want to treat it like an audio book and just get quiet if other sound effects need to play, not stop).

StefanVam commented 4 years ago

Hi,does anyboy have solution?I'm a newbie of XF,I encounter this problem on ios too,I want to know how to handle it.Thanks!

lduchosal commented 4 years ago

This looks like a bug for new comers. I was wondering for hour why the sound wasn't playing. Youtube video were playing fine. Xam. SimplePlayer was not working.

I checked out the repo and played the samples : no sound either. I was about to open a new issue and I found this one .

Hardware silencing was enabled.

elbrinner commented 4 years ago

When testing on an Ipad mini 5, the sound does not work either, but in the simulator it does. But in my case it was a system option that hardly impacted some types of audio. In most apps it had sound but in mine and another one it didn't.

BlueRaja commented 1 year ago

Was a configurable option ever added? Or do we need to switch to a different audio player? Because this is a deal-breaker bug.

[Edit] Just saw this post which provides a workaround.