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: 
sgranger
Channel Surfer

Audio node prebuffer for playlist

I want to implement an endless musical playlist, with no silence gaps between audio tracks due to prebuffering.

I've tried setting control="prebuffer" on the audio node of the next track while the current track is playing, but doing so fails with errorCode=0 and errorMsg="failed to create media player". Because of that, when it's time to start the next track, it needs time to buffer, which leaves the unwanted silence gap.

I've also tried using the contentIsPlaylist feature of the audio node, which seems to correctly prebuffer the next track while the current track is playing. But when I add new tracks to the audio.content playlist, the node fails with errorCode=-3 and errorMsg="An unexpected problem (but not server timeout or HTTP error) has been detected".

Is there a way to implement a dynamic playlist with no silence gaps between tracks?

0 Kudos
3 REPLIES 3
sgranger
Channel Surfer

Re: Audio node prebuffer for playlist

Interesting. I stumbled upon roAudioPlayer, which has the AddContent method for adding tracks to the current playlist. I tried to integrate it inside my app until I found out it just wouldn't work inside a SceneGraph application. Which left me wondering: what's the use of roAudioPlayer now?

0 Kudos
JesUltra
Streaming Star

Re: Audio node prebuffer for playlist

I have pretty much the same question for Videos.  I want to automatically load next episode, or some other "suggested watching" program when the current ends, preferably without an interruption for buffering.

I do not want to pre-populate the entire sequence of episodes, or a chain of suggested programs to watch, as my server API provides only one "watch next" item at a time.  I had hoped to be able to call the server once there is maybe 30 seconds left of the currently playing video, giving the Video player enough time to pre-buffer the next episode while the current finishes, and seamlessly start playing the next.  I see that the Video node has support for a playlist, but the documentation states that once playback has started, modifications to the playlist will be ignored.

I also considered creating two Video nodes, and alternating which is visible, so that the one in the background could pre-buffer the next episode, but I hear other developers say that you cannot have one Video playing while another is prebuffering (or playing).

0 Kudos
JesUltra
Streaming Star

Re: Audio node prebuffer for playlist

Sorry for hijacking this audio related thread.  But I feel that I should post an update.  I have found that contrary to the documentation of the Video node, it does in fact recognize if I add more items to a playlist, while it is playing, at least on my Rok Ultra with software version 9.30.  It did not properly respond to past items being removed from the playlist, the contentIndex value stayed the same, instead of decrementing.  But I have found that it is acceptable to just go on adding new video items to the playlist on demand, as long as my viewers keep binge watching.

As long as I add the next video at least 30 seconds before the current one has completed, then in my experience I do not see any loading/prebuffering screen.  If the video is added later than that, or if the user triggers Video.control = "skipcontent" to skip the credit screens and go to the next episode ahead of time, then a brief loading page may show.

As far as I can see, the Audio node has the exact same playlist support as the Video node.  I would encourage you to try creating a playlist, and adding a second item to it right after starting playback of the first.

0 Kudos