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: 
belltown
Roku Guru

Re: How to play audio content in SDK videoplayer

"RobSMS" wrote:
I implemented this code, but I have one bug I just can't figure out when playing a shoutcast/icecast stream.

On my Roku 2XD it sometimes buffers for up to 2 minutes, then starts playing fine. Occasionally it starts after 2 or 3 seconds.

I thought it was the shoutcast stream or my wireless connection, but then I tried it on my Roku 3 in a room that is farther away from my router and it worked fine every time.

Any ideas?

It appears to be a long-standing bug in roAudioPlayer. I played around with various workarounds. What I'm currently doing is when I get the audio player's IsStreamStarted event, Pause then Resume the audio player, giving it a little Sleep time to think about it. It seems to work about 98% of the time. Something like this:


Sleep (350)
audio.Pause ()
Sleep (350)
audio.Resume ()


It doesn't seem very effective on the 3.1 firmware though. It still takes a while to buffer in that case. However, I'll change the text on the roSpringboardScreen's Play/Pause/Resume button to display a percentage showing how much buffering has been done, in response to the IsStatusMessage "startup progress" message so the user knows something is really happening (albeit slowly) rather than the channel having hung. I know this works on the Roku 2XS. I don't have a Roku 3, so I've no idea how it works (or if it's necessary) on that unit.
0 Kudos
RobSMS
Visitor

Re: How to play audio content in SDK videoplayer

Yeah, that seems to have fixed the issue. I like the idea of updating the buffer onscreen, thanks for the tips 🙂
Need Apps Templates? Content Management for OTT/IPTV? Check me out @ http://rovidx.com
0 Kudos
LordDewi
Visitor

Re: How to play audio content in SDK videoplayer

Thank you @belltown for posting this. I wish I'd found this a few months ago. I actually wound up using this method for the channels I've been working on accidentally. I was trying to create audio channels using RSS feeds and the MRSS example only used video samples. After trying to modify the example Audio Player code, which uses roAudioPlayer, I just changed the <streamformat> in the videoplayer to mp3 and it worked and I was easily able to pull in an RSS feed to fill it.

I didn't change the appDetailScreen so I'll definitely look into that as currently it plays but shows no detail on the MP3 Audio stream, other than the title. I've seen that most Audio only channels play the audio while continuing to display the individual episode's screen, with my example it goes to the uiVideoScreen.brs screen and just shows the title and progress, which isn't horrible but with audio, I'd like to keep displaying the individual episode screen, NWM_MRSS.brs in my case. I'll look into the appDetailScreen.brs changes, although I don't see that in the MRSS example, but I'll look for it in the videoplayer example and play around with it.
0 Kudos