Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game not works in mobile safari #7

Open
thefabhub opened this issue Jan 28, 2015 · 2 comments
Open

Game not works in mobile safari #7

thefabhub opened this issue Jan 28, 2015 · 2 comments

Comments

@thefabhub
Copy link

Hi, the game stuck on loading on mobile safari (ipad and iphone), disabling the audio files loading make it playable but no audio of course ;). Any clues?

@nicholaswmin
Copy link

mobile browsers on iOS are restricted to playing sounds ONLY when using a user-initiated event, e.g a click,scroll etc. There is no workaround for this since it's a system-wide restriction imposed by iOS itself.

@xavierjs
Copy link

Hi,
I have the same issue with an IPAD PRO on Safari 11. You can fix it in pacman.js, line 704 you have:

        f.addEventListener("canplaythrough", progressEvents[name], true);
        f.setAttribute("preload", "true");
        f.setAttribute("autobuffer", "true");
        f.setAttribute("src", path);
        f.pause();        

replace this by :

        f.addEventListener("canplaythrough", progressEvents[name], true);
        f.setAttribute("preload", "true");
        f.setAttribute("autobuffer", "true");
        f.setAttribute("src", path);
        if (f.load){ //SAFARI FIX
            f.load();
        }
        f.pause();        

Then it works like a charm :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants