- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, i want to use setinterval function on intel XDK, but when i test it on android App Preview, the setinterval function is working, and when i use it on the real devices, it not working.
I just want to make a check status every second for connecting audio online like this:
function checkStatus(){ if(radio.currentTime > 0 && !radio.paused){ status.innerHTML = "<font color='#00ce27'>Connected</font>"; } } setInterval(checkStatus,1000);
Thank you before ^^
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adam -- try a simpler test, like:
var toggle = true ; function checkStatus() { if(toggle) { status.innerHTML = "<font color="#FF0000" face="courier" size="10">RED</font>"; toggle = false ; } else { status.innerHTML = "<font color="#000000" face="courier" size="10">BLACK</font>"; toggle = true ; } } setInterval(checkStatus,1000) ;
Could also be due to this > http://www.w3schools.com/tags/tag_font.asp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Paul F. (Intel) wrote:
Adam -- try a simpler test, like:
var toggle = true ; function checkStatus() { if(toggle) { status.innerHTML = "<font color="#FF0000" face="courier" size="10">RED</font>"; toggle = false ; } else { status.innerHTML = "<font color="#000000" face="courier" size="10">BLACK</font>"; toggle = true ; } } setInterval(checkStatus,1000) ;Could also be due to this > http://www.w3schools.com/tags/tag_font.asp
Thanks for your reply ^^. But i just want to check every second is the audio playing or not yet, i think <audio> currentTime is not working on Intel XDK?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adam -- I recommend you first debug your problem with setInterval. It sounds like you've got multiple issues at play, and it's better to fix one issue at a time, thus my recommendation. I have no idea what the radio object is, so I cannot comment on that.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page