You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/03/27 15:29:58 UTC

[GitHub] [cordova-plugin-media] walmink commented on issue #220: iOS ringer status ignored after playing second sound

walmink commented on issue #220: iOS ringer status ignored after playing second sound
URL: https://github.com/apache/cordova-plugin-media/issues/220#issuecomment-477210307
 
 
   I've found the issue. Because the situation can hardly be gathered from the [Cordova documentation](https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-media/#ios-quirks), here are the specifics:
   
   On iOS, you can pass an object to `media.play()`, with a property called `playAudioWhenScreenIsLocked`. By default, this property is set to `true`. Now because the property is passed along with a call to a specific sound object, you may think (like me) that this property will only affect that specific sound. Not so! It's actually setting something globally. And because the property is set to `true` by default, if you don't set it every single time you play a sound, you'll implicitly be setting it back to true. Despite the name referring to the screen being locked, this property somehow also seems to affect whether there is sound based on the physical ringer switch.
   
   Conclusion: It seems that, if you want the ringer switch to work on iOS, you always need to pass `{playAudioWhenScreenIsLocked: false}` along every time you use `playSound()`.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org