I can not get sound (createSound) and music(ipod) to play when the slider is locked. BackgroundModes are set in plist and tiapp.xml. Is there a work around, am I missing something, or is it just not going to work?
When app is running in foreground:
Sound and music play together.
When locked:
Sound only works. Music only works. Sound and music: Only music plays.
var player = Titanium.Media.systemMusicPlayer; var audioPlaying = systemAudioPlaying(); if (audioPlaying) { player.pause(); } PlayAudio(audio[timerRepeat], audioPlaying); function PlayAudio(files, audioplaying) { //code here to play audio files var sound = Titanium.Media.createSound({ url : '/sounds1/' + files + '.wav', allowBackground : true }); sound.play(); if (audioPlaying) { setTimeout(function() { player.play(); }, 4500); } } function systemAudioPlaying() { if (player.playbackState == Titanium.Media.MUSIC_PLAYER_STATE_PLAYING) { return true; } else { return false; } }