Topic: Polling BTPlay Status
Hi everyone,
I wrote a simplistic MP3 player application for the Infocast 8 as a gift for my grandfather, who isn't very technologically inclined. The app lives on a tiny, permanently installed USB drive which gets run on startup via the debugchumby file. It keeps track of available MP3 files with an array, and plays them using BTPlay.
I have the whole thing working pretty well, except for one little issue... I know there are no BTPlay events accessible through Flash, so I'm polling _getPlayerStatus() to determine when a track ends in order to play the next one. About 30% of the time, it works like it should. The status switches from 2 ("playing") to 0 ("paused"/stopped) at the end of the track. Then my interval timer picks up the change and plays the next track in the sequence.
The other 70% of the time, it seems like the status never changes; it just stays on 2, then plays a random song out of sequence. Do you have any idea why this happens? I've debugged this for hours, so I'm confident that the problem is _getPlayerStatus() not changing. I made sure there aren't any playlists running in BTPlay, and I even dug into the source a little, but no luck... I'm wondering if there's a setting I'm overlooking.
I really appreciate your help! Thanks!
-Paul