Music not playing on Mac/Safari

0 favourites
  • 3 posts
From the Asset Store
6 looping tracks to use in your games and projects. These tracks are in the style of the 1960s detective movie genre.
  • Hi everyone,

    I have big troubles playing music on a desktop Mac using Safari. I tested my game on two different hardwares and the result is the same: No music is actually playing.

    I am fully aware of the iPad/iPhone limitation that music only starts playing when a touch occurs, and the game is designed to take that into account. However, the problems mainly happen on desktop. (It also happen sometimes on iPad, but most of the time the music plays correctly)

    I could resolve the problem by placing the music in the sound folder, but as you know the download would much heavier, so I would like to avoid that if possible.

    When playing the game on Chrome on a Mac desktop, the music plays correctly.

    Any idea/solution for this problem?

    If you want to test it for yourself :

    (the menu music is actually placed in the sound folder, so it will play even on Safari)

    Thanks !

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Make sure music files are not 00:00 length, instead of using Construct 2 event for Music Play Try this out,

    • Add Browser instance in Game,
    • Add an event of Execute JavaScript at that required location where you want to play that Audio.
    • Write this event into it.

    "var sound=new Audio('media/sound.mp3');;"

    change the URL as per your requirement.

    Media is the Folder and sound.mp3 is the file name.

    Do let me know if this works.

    Btw checked your game, Its amazing. Loved it.

  • Hi alimuqaddas , thanks for your help and kind words.

    I tested your solution, here is how the execute javascript looks :

    "var sound=new Audio('Music/mymusic.m4a');;"

    I guess that's how you meant it to be done?

    Sadly, it doesn't work better than with the C2 audio plugin.

    The command line seems to work, as the music is playing correctly on Safari installed on a PC or from an iPad. It doesn't work in other browsers (which is normal, as I just launch the .m4a file and other browsers require .ogg files), and doesn't work either on Safari from a Mac.


    Any other solution for this problem? Anyone else experiences it?

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