Variables not updating on iphone

Forum for discussing building user interfaces for controlling MLServer using the iPhone or iPod Touch.
jtcox100
Newbie
Newbie
Posts: 10
Joined: Thu Nov 13, 2008 10:04 pm
Contact:

Variables not updating on iphone

Postby jtcox100 » Sun Jan 31, 2010 12:28 pm

I have reworked the music.HTML file to reflect the correct variables with the new 3.75 version of MusicLobby. For some reason, the variables are not updating for me automatically without forcing a refresh. I am almost positive I had this working, and I am not sure why it is not now. For example, the progress bar and cover art do not update when a song is playing or changes unless I force a refresh. I haven't changed anything in the script or the HTML except for the MainLobby variables. I plan to change the script next to recode the buttons, but I haven't done that yet. I did add the following just to see if it would work:

< meta http-equiv= "refresh" content = "5" />

This works but it is ugly as it is obviously refreshing the entire HTML page. It is livable on Windows but not on the iPhone. I see there is an updatefreq variable in the bottom of the HTML file but I haven't messed with this, and according to the script, it should be updating every second. Not sure if anyone else has experienced this... I am happy to share the HTML and modified script when I am finished... although I think that Cinemar is close to releasing this :D

Thanks,
Todd.

bigDvette
Expert
Expert
Posts: 718
Joined: Thu Oct 12, 2006 12:19 pm
Contact:

Re: Variables not updating on iphone

Postby bigDvette » Sun Jan 31, 2010 1:10 pm

Did you change both versions of the variable. There is the variable with {{ }} around it and the one that is the id of the span tag.

The id of the span tag is bundled up and sent to the server for updates by the getvars function.

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: Variables not updating on iphone

Postby CinemarDave » Mon Feb 01, 2010 12:44 pm

Do not use the meta refresh. The GetVars routine runs on a timer and will use Ajax style calls to dynamically refresh the page. You need to make sure that the unique Id of the refreshed field matches the name of the server variable being refreshed.

jtcox100
Newbie
Newbie
Posts: 10
Joined: Thu Nov 13, 2008 10:04 pm
Contact:

Re: Variables not updating on iphone

Postby jtcox100 » Mon Feb 01, 2010 2:37 pm

Dave,

Somehow the main javascript file had become corrupted. I started from the beginning with fresh files and now the variables are updating. I just need to rework the script so that the percent complete and the total track time are correct. The progress bar is working as are the control buttons at the bottom, cover art, etc. I am actually designing additional pages to control my Russound, very similar to Russound's RNET Touchpoint product, to be able to control zones, switch sources, display meta data etc. It is a considerable amount of work as you might guess. How close is Cinemar to having the next version of the iphone code, and is there any focus on whole home audio controllers? This is for a customer of mine that will require this functionality in the next couple of months.

Thanks,
Todd.

wnl
Member
Member
Posts: 65
Joined: Mon Oct 26, 2009 10:19 pm
Contact:

Re: Variables not updating on iphone

Postby wnl » Fri Mar 19, 2010 12:26 am

I have just finished the necessary changes to Music.html and iPhone.js so that they use the MuL 3.75 variables. Not sure where I can upload them so others can grab them. jtcox, to get the page to properly display the percent and times you need to make changes to iPhone.js. The function MusicProgress is supposed to be called with the variable that contains the percentage. Then it does string substitutions on that variable name to get position, track duration, and mute status. Those substitutions have to be changed to use the new variable names. You also have to drop the calls to parseInt and time as the 3.75 variables are already formatted as minutes and seconds. I also commented out the retrieval of mutestatus as I can not find any equivalent in 3.75. You also have to change the Music function to build the correct MusicLobby command and change some of the uses of that function in Music.html to get the remote control keys to work.

Now that I've got it all done I don't really like the way it looks and behaves. Oh well: at least now I can tweak it. We still be browsing and selection via the iPhone web interface.

Bill


Return to “iPhone / iPod Touch Beta”

Who is online

Users browsing this forum: No registered users and 1 guest