Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
roquoonewbie
Visitor

Re: Audio progress bar not showing

OK, thanks for the clarification. So is there any sample app that shows the progress bar?

Even the audio player sample app in the sdk has no progress bar. And I am at a loss how to get it to show.
0 Kudos
roquoonewbie
Visitor

Re: Audio progress bar not showing

Still no love here? Does anyone have a single functioning example of an audio player app that shows a progress bar? Googling around seems to bring up nothing but this thread about it not showing for others.

Also, how do you get the current playback position of the audio player (to update the progress bar via the SetProgressIndicator method)? The videoplayer object exposes the position to Brightscript. But I don't see how the audioplayer does the same. So how would the application know what the correct position is? Keeping a timer wil be very inaccurate and error prone (through pauses/resumes/buffers, etc), so I assume there must be a way to query the player to get the correct position at any given time?
0 Kudos
TheEndless
Channel Surfer

Re: Audio progress bar not showing

"roquoonewbie" wrote:
Keeping a timer wil be very inaccurate and error prone (through pauses/resumes/buffers, etc), so I assume there must be a way to query the player to get the correct position at any given time?

Bad assumption.. 😉
There have been a couple of discussions about it in the past. Your best bet is probably to use a "timer" roTimespan and a "playingTime" Integer to track the seconds during playback. Mark() the "timer" at the start of play, then store the elapsed seconds (additive) in "playingTime" any time you enter a pause or buffer state, then re-Mark() on resume. If playing, your elapsed time (the time you pass to SetProgressIndicator) would be playingTime + timer.TotalSeconds(). If paused, your elapsed time would simply be playingTime.

Does that make sense?

As for showing the progress bar, make sure your contentType is "audio" and you call SetProgressIndicatorEnabled(True).
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
roquoonewbie
Visitor

Re: Audio progress bar not showing

Mystery solved. Apparently if you do a SetPosterStyle on an audio springboard, it overrides the setting to include the progress bar.

So the answer is...to get a progress bar to show, don't call SetPosterStyle. Strange that these two things affect each other.
0 Kudos
roquoonewbie
Visitor

Re: Audio progress bar not showing

Regarding your timer suggestion, how does one know when the audioPlayer goes into a buffer state? I see no such event/state.

Seems really silly that you can't just tell the screen to show the bar and let it manage the playhead position/updates.

The player is aware of the duration and the position, so I don't see why hacking a separate timer in the script is required here when the sub-system can do this all.
0 Kudos
destruk
Streaming Star

Re: Audio progress bar not showing

would be nice.
0 Kudos
TheEndless
Channel Surfer

Re: Audio progress bar not showing

"roquoonewbie" wrote:
Regarding your timer suggestion, how does one know when the audioPlayer goes into a buffer state? I see no such event/state.

isStatusMessage(), look for "startup progress".

"roquoonewbie" wrote:
Seems really silly that you can't just tell the screen to show the bar and let it manage the playhead position/updates.

The player is aware of the duration and the position, so I don't see why hacking a separate timer in the script is required here when the sub-system can do this all.

That, my good man, is a fine question... one that you'll have to ask Roku. I suspect it's related to the same reason you can't call Seek() on MP3 files, which is also a mystery.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.