Skip to main content
Borp
Participant
July 21, 2020
Question

HTML game not loading on iPhone iOS 13.5.1 and above

  • July 21, 2020
  • 1 reply
  • 1781 views

I'm currently working on trying to resolve an issue with an HTML5 game create in Adobe Animate 2020.

 

The problem is when it is played on specifically iPhones running an iOS at either 13.5.1 or higher. All other android devices and even iPhones/iPads using a lower iOS work fine.

 

The first page/level loaded will always work fine. I am using the following code to navigate my folder structure:

window.location = "../level02/level02.html";

After maybe a level or two the game will be stuck on the default background colour I have set in the Animate build file and the script is seemingly stopped from firing.

 

On the iPhone I was using that was running iOS 13.6, I went into the Safari cache and it was when I deleted only the "create.js" cache by itself and not the actual browser cache that it would force the page to reload and then it would work as intended. Pressing refresh would not work and going back to previous pages would now have the same blank screen as well.

In my files, the create js code I am using is:

createjs.Touch.enable(stage);

this.musicplay = function() {
	this.mainmenu = createjs.Sound.play("menumusic", {loop: -1});
}

this.musicplay();

All pages have the touch enable code and only some have music.

 

What is it that could be carrying over from previous pages that collect and stop the next ones from working? Also why is it only on iPhones running this iOS 13.5.1 or above and not other devices?

Please note I am very new to all of this so go a little easy on me.

 

Appreciate the time taken to read all this text.

This topic has been closed for replies.

1 reply

JoãoCésar17023019
Community Expert
Community Expert
July 21, 2020

Hi!

 

Developing for iPhone is always a challenge...

 

It's hard to figure it out what's going on without actually seeing the game and testing in it. Do you mind providing a link to it? Even if you have to send it in private or if you need to use placeholder assets.

 

In the meantime, my best guess is that sound playback may be the cause for your issues. In the past few years, browser vendors have become very restrictive when it comes to allow sound and video playback.

 

So it's a good idea to check if it will be necessary for each page to have a first interaction from the user to allow sound playback or if you're gonna need a special attribute in some media element (e.g.: playsinline in video tags).

 

It can also be some sort of incompatibility from CreateJS.

 

Please let us know.

 

Regards,

JC

Borp
BorpAuthor
Participant
July 21, 2020

Thank you for your reply! 

 

Yeah the audio could definitely be an issue as I do have some music that attempts to fire on window load sometimes.

 

I will send you a message with a link so you can test it out.

Borp
BorpAuthor
Participant
July 21, 2020

Hi again.

 

Thanks for the link.

 

By taking a quick look, my best guess is that you should really request user interaction before playing the first sound in every new page you load.

 

Please test if this approach works and let us know.

 

And by the way: what an amazing game! Really cool design and animations! Congratulations!


Thanks for the kind words! Glad you enjoyed it. Also appreciate the time put into testing it.

 

With the request of user interaction, do you mean just making sure the user has to press a button or something before playing a sound? Or is there a specific code that helps with this too?

 

Thanks again.