0 Favourites

How do I get music to play in web browser?

  • Hey guys

    Loving the program but for some reason I cannot for the life of me get music to play in my background when I run my HTML5 game on Safari on iOS. This is across a bunch of different iOS devices. Any browser on a PC it works perfectly .

    I tried messing around with preload but I don't think it's working or that wasn't the problem.

    Any clue?

    splashdown.lipowered.com/hncc

  • Anyone?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Yes I've encountered this before. You'll need to put a touch to play screen or something similar in before that intro movie. From ze manual :

    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.

  • thank you thank you thank you

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