Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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?

— asked May 27th 2010 by Allen Bargi
  • background
  • music
  • window

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!

    — answered May 27th 2010 by Scott Robinson
  • Will it run on the background even if the application is closed?

    — answered June 6th 2010 by Herculano Campos
    • This isnt possible on the iPhone because of the was the current OS is made.

      — commented June 6th 2010 by Scott Robinson
    • I mean in Android, can this run as a BackgroundService?

      — commented June 9th 2010 by Herculano Campos
  • Hmm well! I use it is works but sometime when I open a new window it make some interruption in playing music.

    — answered March 12th 2014 by Ruby Tomlinson
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.