LibGDX RoboVM allowIpod does not work if the game starts after a pause

I am developing a game for iOS using libGDX and Robovm; however, I need the user to be able to save background music (ipod or other applications) while playing during the game. I added a configuration parameter allowIpodto IOSApplication:

protected IOSApplication createApplication() {
    IOSApplicationConfiguration config = new IOSApplicationConfiguration();
    config.orientationLandscape = true;
    config.orientationPortrait = false;
    config.allowIpod = true;
    return new IOSApplication(new Game(), config);
}

However, if the music was played before launching the application, it continues to play after opening the game. But, if I start the game, then press the "Home" button, then play the music, then return to the game, the music will stop.

Has anyone encountered a similar case? Any help please!

thank

+4
source share
1 answer

ObjectAL docs ( , libGDX IOSAudio), useHardwareIfAvailable false OALSimpleAudio sharedInstance. , .

OALSimpleAudio.sharedInstance().setUseHardwareIfAvailable(false);

libGDX OALSimpleAudio RoboVM, OALSimpleAudio libGDX RoboVM . - ():

@Property(selector = "getUseHardwareIfAvailable")
public native boolean getUseHardwareIfAvailable()

@Property(selector = "setUseHardwareIfAvailable:")
public native void setUseHardwareIfAvailable(boolean b);
+2

Source: https://habr.com/ru/post/1539283/


All Articles