I was testing something to make my app still run while in suspended mode, so I tried playing a song even if the app is suspended/sleep(just like in an mp3 player)
so here is my code :
gameMusic = audio.loadStream("Blue Chase\_0.mp3") gameMusicmenu = { loops = -1} musicCaller = audio.play(gameMusic, gameMusicmenu) local function onSystem(event) if event.type == "applicationStart" then print("start") elseif event.type == "applicationExit" then print("exit") elseif event.type == "applicationSuspend" then print("suspend") elseif event.type == "applicationResume" then print("resume") end end Runtime:addEventListener( "system", onSystem )
I just want to keep it playing even If i press home/back in android, suspend in simulator, and home in iOS, but whenever I do that the song pause,