How do I get a music file to automatically play on mobile

  • I have a music file which is set to play after an initial start animation finishes. On the PC this works fine but no a mobile device (Running in chrome through bitballoon) the sound does not load until a screen touch is registered.

    I can probably sort a work-around but wondered if there is a proper fix for this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a music file which is set to play after an initial start animation finishes. On the PC this works fine but no a mobile device (Running in chrome through bitballoon) the sound does not load until a screen touch is registered.

    I can probably sort a work-around but wondered if there is a proper fix for this?

    From the manual:

    [quote:2vv3ykyf]

    Mobile limitations

    Safari on iOS and Chrome for Android share a limitation in playing music. While sound effects can be played at any time, music is only allowed to start playing when the user touches the screen. This is a limitation in the browsers themselves. As a result, if you play music on the start of layout, you may find in these browsers it does not actually start until the next touch.

    Safari on iOS has a further limitation that no audio can play at all until the first touch. In other words, audio starts off muted and the first touch unmutes audio playback.

    Usually you do not need to handle this in your events. If you try to play sound or music on 'start of layout', the audio object will automatically queue it up for playback the next time the user touches the screen. However you should be aware of this when designing your game. If the first touch changes layout or stops the music, then the music may never be heard. You may want to start playback then encourage the user to touch the screen with a 'Play' icon or something similar.

  • Thanks zenox98 I search the forum but didn't see this in the manual!

    I've changed the sound from my Music folder to my Sounds folder and now it loads. Not sure if any differences this way but from what I have just tested works fine

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