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

Music not looping #97

Open
Rombusevil opened this issue Apr 19, 2016 · 3 comments
Open

Music not looping #97

Rombusevil opened this issue Apr 19, 2016 · 3 comments

Comments

@Rombusevil
Copy link

Rombusevil commented Apr 19, 2016

Unfortunately I don't own a device in which this happens, but I have been reported that on LG devices (LG Power Android 5.0, LG nexus 5) the music doesn't loop. (On PC, and my 4.4 and 4.1.2 devices works as expected)

The code for looping music is right from the wiki: FlxG.playMusic(Music, 1f, true, true), and the files are .ogg.

Someone else got this issue?

I would manually restart the audio track, but how do I check if the music has stopped?

@WingEraser
Copy link
Member

WingEraser commented Apr 19, 2016

Load the music via FlxSound yourMusic = FlxG.loadSound() and be sure to set the type to MUSIC and set the loop on false.
yourMusic.active tells you whether the music is playing or not.

@Rombusevil
Copy link
Author

Thanks! I'm making a test app with what you suggested to see if I can get someone with an LG device to test.
I'll report the results hopefully in a few days.

@Rombusevil
Copy link
Author

Well... I couldn't get anyone to test it. But I tested stopping the audio on purpose and adding a check for FlxG.music.active == null on my update() method, and if the active is null, I call to FlxG.playMusic again. That seems to work fine.

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

2 participants