Jump to content

Sound doesn't play if there is no internet on mobile with cocoonjs[Fixed]


angelkom
 Share

Recommended Posts

The music and the sound doesn't play if the internet connection is off on cocoonjs

 

Update:

 

Yesterday I was in bed and I couldn't sleep I was thinking how to fix the sound. I had the game in my phone and I remembered on the sound engine source files so I checked them. What I noticed is that Enpu has disabled the sound if there is no internet connection on the smartphone. I don't know why he did that but maybe he did it on mistake, anyway here is the fix:

 

1.Open the sound.js located in the engine folder

 

2. Go to line 46 and notice this statement:

 

if(!navigator.onLine && game.ua.mobile) {
            game.SoundManager.webAudio = game.SoundManager.enabled = false;
        }
 

this tells the sound engine to not play if there is no internet on the mobile.

 

3. There are two ways two fix it:

 

3.1 Set game.SoundManager.webAudio = game.SoundManager.enabled = true;

 

3.2 Delete the whole statement.

 

I think the second deleting the whole statement is better and it doesn't give any errors I checked in the cocoonjs console :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...