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

Video + List

Hello,

I’m trying to create a channel from scratch that launches a video link and allows users to display a list of the other available channels while the video is still playing (a text list at the left of the screen).
If the user clicks on a link, the new video launches and the list disappears until he presses the OK button to make the list appear without stopping the video

I created the following folders + a manifest file:
- Components
- Images
- channels
- source

in the channels folder I created the following xml file :


<?xml version = "1.0" encoding = "utf-8" standalone = "yes" ?>

<VideoContent >
<video
title = "AAA"
streamformat = "hls"
url = "link.hls" />
<video
title = "BBB"
streamformat = "hls"
url = "link.hls" />
<video
title = "CCC"
streamformat = "hls"
url = "link.hls" />
</VideoContent>


in the Components folder I created the following xml file :


<?xml version="1.0" encoding="utf-8" ?>

<component name = "my videos" extends = "Group" >

<script type = "text/brightscript" >

<![CDATA[

sub init()
setVideo()
end sub

sub setVideo()
videoContent = createObject("RoSGNode", "ContentNode")

videoContent.title = "video"
videoContent.streamformat = "hls"
videoContent.url = "link.m3u8"

m.video = m.top.findNode("video")
m.video.content = videoContent

m.video.control = "play"
end sub

function onKeyEvent(key as String, press as Boolean) as Boolean
if press then
if key = "ok"
m.videolist.setFocus(true)
return true
end if
end if

return false
end function

]]>

</script>

<children>

<Video
id = "video"
width = "1280"
height = "720" />
<LabelList id = "MyList" >

<ContentNode role = "content" >

<ContentNode title = "Link 1" />

<ContentNode title = "Link 2" />

<ContentNode title = "Link 3" />

</ContentNode>

</LabelList>

</children>

</component>


When I launch the channel the video plays and I can see the list (I can't scroll down though).
How do I link the videos in the channel's folder to the list in my components XML file ?

Do you see something else missing in my code ?

Thank you for your help
0 Kudos
4 REPLIES 4
jamilou
Visitor

Re: Video + List

Any idea ? or a template that already does that ?
0 Kudos
jamilou
Visitor

Re: Video + List

Is there anyone who can point me in the right direction? I'm still completely stuck on this.
0 Kudos
RokuLeoW
Visitor

Re: Video + List

Hi Jamilou,

It seems like this question was resolved by your more recent post here: viewtopic.php?f=34&t=95899

For anyone looking at this post, there is an example in the SDK1 docs that implements a custom playback list while video is playing located here: http://sourceforge.net/projects/rokusdk ... p/download
This example is a bit outdated as it does not use SceneGraph/SDK2 concepts.

Additional templates/code examples (as well as information about the Roku developer program) are located here if anyone is curious:
https://sdkdocs.roku.com/display/sdkdoc ... er+Program

For anyone who wants a template using SDK2 (SceneGraph + BrightScript), I made an SDK2 template located here that uses the base SceneGraph components provided in SDK2:
https://github.com/LeoWW/custom-playback-channel

Note: A labellist also has the scrolling capability that you are requesting for in your more recent post 🙂

If anyone has any additional questions, please let me know; hope that helps!
- Leo
0 Kudos
EnTerr
Roku Guru

Re: Video + List

"RokuLeoW" wrote:
This example is a bit outdated as it does not use SceneGraph/SDK2 concepts.

Ahem. Let's put the record straight: a code is not "outdated" if it can do the job. Just like Roku is not outdated for using BrightScript or low-spec hardware.

SDK1 ("ro" components) was designed to be simple to use, SDK2 ("sg" components) is not. As such, the latter should not be prescribed to beginners.
0 Kudos