Hello, I am making a music player like widget which will be a bar at the bottom of each player. A user can traverse from one window to another but the widget will be present on all windows and will have a progress bar and song title and buttons etc.
If the user plays a song on a window and then moves to other window then he would see the same progress and also the same title on the new window and so forth.
If the user then changes the song, then the song titles should be updated across all the currently open windows in the background. ie if the user clicks back and closes the current window then the previous window should also have the currently playing songs progress and titles.
I was able to achieve this functionality using the Titanium.App.fireEvent()
Titanium.App.addEventListener('musicPlayerTitle', function() { Ti.API.info('call for musicPlayerTitle'); $.title.text = Alloy.Globals.Songs[Alloy.Globals.SongsHead].song_title.title; // Global Variable for song title. });Now I can change the titles etc. But whats happening here is that this function gets called even for the closed and destroyed window.
So I need help in 2 things.
- Can we have a different approach for the bottom music bar. ie. a global view which will stay common across all windows.
- If not then how can I manage this changes for titles and progress bar across all windows and at the same time not fire those for the closed/destroyed windows.