0
\$\begingroup\$

I have a libGDX/HTML5 project that works well on desktop browsers, but on mobile browsers it has problems.

I can have some sounds on Android browsers (not perfect) but on iPhone browsers it doesn't work at all.

I don't know exactly which part of the project to put in here. There is an mp3 file to be played at menu screen, "music.mp3". I use:

import com.badlogic.gdx.audio.Music;
...
public class MyGame extends ApplicationAdapter {
...
private Music music;
...
@Override
    public void create () {
    ...
         music = Gdx.audio.newMusic(Gdx.files.internal("music.mp3"));
         music.setLooping(true);
         music.setVolume(0.1f);
         music.play();
    ...
    }
}

I would appreciate any help.

\$\endgroup\$
6
  • 2
    \$\begingroup\$ Please note that such links to github are semi-useful: you'll keep on working on the project, making this link completely useless, and you don't want users here to parse through all of your code to find the issue.. Please provide a minimum complete verifiable example here in the question, along with the version of libGDX and the version of the iOS Safari browser you're testing on. \$\endgroup\$
    – Vaillancourt
    Apr 17, 2019 at 2:38
  • \$\begingroup\$ @AlexandreVaillancourt Thanks for the info. The project will be kept unmodified and a new project with the final solution will be created. The example is less than minimum as the libGDX project is not there. Those acquainted with HTML5 and CSS could find the problem on those files. There is no test with Safari and all performed tests and results are in the REAME.md at GitHub. \$\endgroup\$ Apr 17, 2019 at 15:04
  • 1
    \$\begingroup\$ @MarceloSilva This is not a trust issue, it's just discouraged in general to post links in questions, unless you really have to. What if github closes down? Even though its not your fault, the link is now broken, rendering this question not helpful for future readers that may have a similar issue. \$\endgroup\$ Apr 17, 2019 at 16:40
  • \$\begingroup\$ @TomTsagk Thanks, I’ll edit and put code snippets that shows the problem. \$\endgroup\$ Apr 17, 2019 at 17:05
  • \$\begingroup\$ Looks like you use old stuff. And that libGDX uses GWT to bridge Java to JavaScript (and GWT has 'Google' in its name). And that Apple is fussy about how audio could be used in its iOS browser. You might want to provide data about your whole pipeline. \$\endgroup\$
    – Vaillancourt
    Apr 17, 2019 at 17:06

0

You must log in to answer this question.

Browse other questions tagged .