Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-620

Phonegap needs a way to detect the state of the iPhone mute button (unsure about other platforms and if they have mute buttons)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • cordova-ios
    • None

    Description

      So, I am using sound effects as part of my interface. Currently I am playing clicks when the user touches one of the buttons, however I have some other stuff I may add soon. I am using the Media object and media.play to do this (perhaps there is a better way I am simply missing).

      I noticed that my Phonegap app still makes the clicks even when I click the mute button, so I looked for details on how to fix this. As far as I could see, from numerous posts about this, there isn't a way. This seems bizarre to me. I couldn't find an answer to the problem. Someone posted a 1-sentence reply and a link to a Stackoverflow answer that was completely in Obj-C, so I don't what they were talking about.

      I even found one post that said that in version 1.0 the mute button DID work, but people complained that audio wouldn't play when the phone was on mute, so the behaviour was changed. Which is craaaaaaaazy. Someone from Nitobi wrote "If sound is critical to your application then it should ignore the state of the mute switch", which again is craaaazy.

      I love Phonegap because, up until now, everything I've tried with it has seemed like an actual native iOs app, and I haven't had those "ugh, ____ feature doesn't work and it makes this look like a cheap kludge" moments I've had with every other alternative to Obj-C that I've tried. This, however, is one of those things.

      iPhone users are used to clicking the mute switch while using an app to turn the sound off, perhaps to talk to someone or whatnot. I do it all the time. If I did it, and the interface kept making sounds, I would instantly hate whatever app I was using, and probably look to replace it immediately. Not having a way for Phonegap developers to mute their app is bizarre, and, while I'm not going to complain to Apple about it, I can't believe they're approving apps that exhibit this behavior, it seems like the EXACT kind of reason they rejects apps for. I have never read the HIG rules as far as muting sounds goes however, because it's SUCH a standard thing, 100% of native apps just do it, it's not even an issue.

      So, what can be done? Is there something I'm missing? I guess right now I'm going to have to leave sounds out of my interface, but that's lazy, and as someone who cares deeply about having a polished, professional interface, adding audio cues is something high on my list of must-haves. I'm not too happy about just giving them up because there's no event to detect the mute button.

      I sure hope I am making a fool of myself and have missed something easy, and that there's a simple solution to this!

      Andrew T.

      Attachments

        Issue Links

          Activity

            People

              shazron Shazron Abdullah
              andrewyeah Andrew
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: