"On suspended" not called on iOS

0 favourites
  • 5 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Hi everyone,

    my teammate and I finished a commercial game project in html5, and after struggling for a while with sound across android and iOS, my teammate finally got it almost working everywhere.

    The problem is that the "on suspended" and "on resumed" events of the browser object aren't called on Safari. Thus, the looped music doesn't stop when pressing home or switching tabs.

    It's working fine on desktop and on chrome in particular. Below, you'll find an example project and capx that you can test directly : the square changes color when the "on suspended" event is being called.

    Online demo

    Capx

    May you have any solution to this problem please ? May there be another way to detect a tab switch or if the user presses the home button on ios and/or android ?

    Kind regards,

    Nathan

  • Nobody has had this problem yet ? Or any potential solutions ?

    Cheers,

    Nathan

  • Just like "Request Fullscreen", it probably just doesn't exist on ios.

    Some companies that make browsers view the html5 specification as suggestions, rather than directions.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Support for this was added in iOS 7, and I just checked on an iPad and it works. Are you using an old version of iOS?

  • I am using iOS 7.0.4 on an iPad 3 here, and it doesn't work when pressing home (the square stays red). When switching tabs inside of safari, it works though.

    We have a machine running on iOS 6 too, and it simply doesn't work there. But if I understand correctly, this is a normal behavior.

    Thanks much,

    Nathan

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)