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: 
agmark
Visitor

Audio progress bar not showing

I've tried about every idea I can come up with to have a Springboard screen display a ProgressIndicator when I add an AudioPlayer, but I'm not getting something right. The screen displays the "audio" style when I add the SetDescriptionStyle ("audio") and I have the ContentType = "audio" along with the setProgressIndicatorEnabled(true). I've been hacking the following relevant code. Can you see anything that prevents the progress bar from being displayed.

springBoard = CreateObject("roSpringboardScreen")
springBoard.SetBreadcrumbText("Breadcrumb Text","")
port = CreateObject("roMessagePort")
springBoard.SetMessagePort(port)
springBoard.SetDescriptionStyle("audio")
springBoard.setProgressIndicatorEnabled(true)
springBoard.setProgressIndicator(0, 1)
springboard.AllowUpdates(true)
springBoard.Show()

audioPlayer = CreateObject("roAudioPlayer")
port = CreateObject("roMessagePort")
audioPlayer.SetMessagePort(port)

song = CreateObject("roAssociativeArray")
song.url = "http://www.my.music.com/song.mp3
song.ContentType = "audio"
song.Title = "Title"
song.Artist = "Artist"
song.Album = "Album"
song.HDPosterUrl = "pkg:/images/test_188x188.png"
song.SDPosterUrl = ""
springBoard.SetContent(song) 'adds song
audioplayer.addcontent(song)
audioplayer.setloop(false)
audioplayer.play()
springBoard.Show()
while true
msg = wait(0, port)
if type(msg) = "roAudioPlayerEvent"
if msg.isStatusMessage() then
print "roAudioPlayerEvent: "; msg.getmessage()
if msg.getmessage() = "end of playlist" return
endif
endif
end while
0 Kudos
16 REPLIES 16
RokuJoel
Binge Watcher

Re: Audio progress bar not showing

Hi,

you need to update the first parameter of the progress indicator with the amount of time passed. (0,1) indicates your content is one second long, which is unlikely, so you need to set a timer with roTimeSpan:

timer=createobject("rotimespan")
timer.mark()



set the length of the track:



springboard.setprogressindicator(0,lengthOfTrackInSeconds)



and count how many seconds have passed since the start with

springBoard.setProgressIndicator(timer.totalseconds(), LengthofTrackInSeconds)


note that LengthOfTrackInSeconds is just an arbitrary name, use whatever variable you have for the actual length of the track.

You might want to listen for the status message "start of play" before displaying and updating your progress indicator, so that it is more accurate.

- Joel
0 Kudos
agmark
Visitor

Re: Audio progress bar not showing

Thanks Joel. I'm still missing something here. As a test, I changed the setprogressindicator to:
springboard.setProgressIndicator(0,10000)
just to see if the indicator would display and I'm not getting it to even show up. I tried changing the first variable to simulate the track in progress and it makes no difference. I've tried making a few changes and still nothing. Anything else you can see?
Mark
0 Kudos
RokuJoel
Binge Watcher

Re: Audio progress bar not showing

what if you set the progress indicator to (100,1000) do you see anything?

- Joel
0 Kudos
RokuJoel
Binge Watcher

Re: Audio progress bar not showing

Also, you need to set your msg=wait(0,port) to a number higher than 0, like msg=wait(100,port) or nothing will update because your program will stop and wait for input, so it can't possibly update the screen.


- Joel
0 Kudos
roquoonewbie
Visitor

Re: Audio progress bar not showing

I am having this same exact issue. Is there a sample app that demonstrates an roAudioPlayer which shows the progress bar? I cannot find one anywhere.
0 Kudos
roquoonewbie
Visitor

Re: Audio progress bar not showing

Also, where is the progress bar supposed to appear? In different SDK docments, it shows it in different places. The ComponentReference.pdf shows the progress bar at the bottom of the screen. But the MockUpTool.pptx shows the progress bar right below the poster image.

This would imply one could configure the screen to do one or the other, but I see no such option. So where would/should it appear given this?
0 Kudos
TheEndless
Channel Surfer

Re: Audio progress bar not showing

"roquoonewbie" wrote:
Also, where is the progress bar supposed to appear? In different SDK docments, it shows it in different places. The ComponentReference.pdf shows the progress bar at the bottom of the screen. But the MockUpTool.pptx shows the progress bar right below the poster image.

This would imply one could configure the screen to do one or the other, but I see no such option. So where would/should it appear given this?

I'm not sure what you're looking at in the component reference, but the progress bar for audio shows under the poster/icon on the roSpringboardScreen. Only the roVideoScreen has a progress bar at the bottom of the screen.
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

Page 42/43.

http://c1807832.cdn.cloudfiles.rackspac ... ce_v28.pdf

Diagram: roSpringboard audio screen, ContentType=audio
0 Kudos
TheEndless
Channel Surfer

Re: Audio progress bar not showing

"roquoonewbie" wrote:
Page 42/43.

http://c1807832.cdn.cloudfiles.rackspac ... ce_v28.pdf

Diagram: roSpringboard audio screen, ContentType=audio

Interesting. I never noticed that before. I'm pretty sure it's an error in the mock-up. The progress bar is definitely under the poster.
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.