[Firefox] Restart Music when reloading a layout

0 favourites
  • 4 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.
  • Hello,

    I have a strange behaviour on Firefox. What I want to do :

    * start a music at the start of a layout,

    * stop it at the end

    * and restart it when I restart the layout.

    It work well on all the browsers I tried except on Firefox (which is my favourite browser ).

    Here's the capx :

    https://drive.google.com/open?id=0B-CQs9SaQCHFb2RsUGhxZENTRjg

    Did someone have an idea to make it work on Firefox ?

    Thank you for your help

  • Hey claurent9,

    I spent some time trying to figure out what was going on, and to summarize my findings, you can drag the music files from the "Music" folder, into the "Sounds" folder, and that should solve the Firefox issue.

    What I tried

    I tried running your project in Chrome, Opera, IE, Iron, NWjs, and Firefox, and only Firefox seemed to fail to restart the music correctly.

    I added a hotkey to restart the music without restarting the layout, and that also failed to restart the music in Firefox, so the problem seems to be independent of the layout restart.

    I ran the project in debug mode, and inspected the "Audio" object.

    When the music plays for the first time, the "Currently playing" debug field reports the audio as playing, and shows the play progress in seconds for the audio file.

    If the music is restarted, the "Currently playing" debug field reports the file as playing and shows the realtime progress just as before, but no audio plays.

    So the Audio object thinks it is playing the audio file, but Firefox isn't creating any sound.

    To use debug mode

    1. Choose the "Home" tab on the ribbon, and click the "Debug layout" button.

    When your project starts up there will be a debug panel in the bottom of the window.)

    2. On the debug panel, on the bar, at the very right, click the diagonal arrow button "?" , to break the debug panel into it's own window.

    The debug panel acts like an x-ray view into the insides of all the objects in your game.

    Finally, I noticed that the music files were in the "Music" folder, instead of the "Sounds" folder.

    I moved the files to the "Sounds" folder (you can just drag and drop from one to the other), in case the issue was streaming related, and afterwards the music restarted in Firefox, without a problem.

    Possible cause

    If I recall, the difference between the "Sounds" folder and the "Music" folder is only how Construct plays them. For files in "Music", Construct tries to stream them, whereas files in "Sounds" will be fully downloaded and played directly.

    It seems like Firefox may handle streaming audio in a way that breaks when you restart it, at least in this case.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • fisholith Thank you for solving my problem and for the detailed explanation !

    Have a nice day

  • No problem, glad it worked out.

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