Xamarin-Plugins icon indicating copy to clipboard operation
Xamarin-Plugins copied to clipboard

iOS: Hardware silencing switch mutes playback

Open BioTurboNick opened this issue 7 years ago • 7 comments
trafficstars

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.

BioTurboNick avatar Apr 04 '18 14:04 BioTurboNick

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

adrianstevens avatar Apr 12 '18 19:04 adrianstevens

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

Osmosis311 avatar May 03 '19 03:05 Osmosis311

+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).

ChetCromer avatar May 20 '19 23:05 ChetCromer

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!

StefanVam avatar Dec 09 '19 09:12 StefanVam

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.

lduchosal avatar Apr 19 '20 22:04 lduchosal

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.

elbrinner avatar Jul 12 '20 18:07 elbrinner

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.

BlueRaja avatar Nov 19 '22 08:11 BlueRaja