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: 
melkat
Binge Watcher

Combine Videoplayer example with SimplePlayer HLS

We're creating a channel that will primarily stream videos on-demand, so we're using the videoplayer example as our primary template. However, I'd like to add a link to our live stream from the first screen that appears. Currently, the first screen shows the contents of the category.xml feed. How would I add an image/link on that screen that, when clicked, goes directly to our live stream, as follows:

Live Stream | Category A (from categories.xml) | Category B (from categories.xml)

Selecting the Live Stream would automatically play the live stream. Selecting one of the categories would show the function as it currently does in the videoplayer example, by showing the "categoryLeaf" elements and their corresponding xml feeds.

As you can probably tell, I'm very new at this, so please let me know if there's any other information I can provide.

Thanks,

M
0 Kudos
3 REPLIES 3
RokuJoel
Binge Watcher

Re: Combine Videoplayer example with SimplePlayer HLS

Haven't tested this, but I think if you replace this:

<streamFormat>mp4</streamFormat>
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>1500</streamBitrate>
<streamUrl>http://video.ted.com/talks/podcast/SethGodin_2003_480.mp4</streamUrl>
</media>


with this:

<streamFormat>hls</streamFormat>
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>500</streamBitrate>
<streamUrl>http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8</streamUrl>
</media>


Might do the job. Set the bitrate to the lowest bitrate of a multibitrate stream, or the bitrate of a single bitrate stream, if you set 0 as your bitrate, it will take a longer time to buffer and stream.

- Joel
0 Kudos
melkat
Binge Watcher

Re: Combine Videoplayer example with SimplePlayer HLS

Hi Joel,

Yes, that would work, but I was hoping to bypass the click-throughs to get to that point. As it is now, a user has to click once to select Live Stream, then again, on the "kid" element for Live Stream, the again by clicking "Play" on the details screen. Ideally, I would like a user to click the first Live Stream button on the first page and immediately launch the live stream.

Any ideas?

Thanks!
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: Combine Videoplayer example with SimplePlayer HLS

"melkat" wrote:
Yes, that would work, but I was hoping to bypass the click-throughs to get to that point. As it is now, a user has to click once to select Live Stream, then again, on the "kid" element for Live Stream, the again by clicking "Play" on the details screen. Ideally, I would like a user to click the first Live Stream button on the first page and immediately launch the live stream.


You could leverage the specialCategory logic in the sample channel. Most of that code lives in categoryFeed.brs and appHomeScreen.brs. There might be a few other tweaks needed, but basically you'd add the code for playing your live stream to displaySpecialCategoryScreen() then add a specialCategory element to your XML for your live stream.
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.