Playing Music on Background
I'm working on a radio app and it needs to have a "currently playing" window which is always open and playing on the background so that user can browse other pages and windows on the app while listening.
How can I have a window remain open in the background and how I can get access to it again when the user is clicking on another radio station to listen?
3 Answers
-
Hi,
Not quite sure what you meant by the second part of the question… But you can have an audio player on a window which will continue to play when you browse other windows!
var url = "http://radiosonar.solent.ac.uk:8000/streamhi.mp3"; var streamer = Titanium.Media.createAudioPlayer({url:url,preload:true,allowBackground:true});
The allowBackground was only required for Android! Theres some more info in the kitchensink!
-
Will it run on the background even if the application is closed?
-
Hmm well! I use it is works but sometime when I open a new window it make some interruption in playing music.