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

Any idea ? or a template that already does that ?

Is there anyone who can point me in the right direction? I’m still completely stuck on this.

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 :slightly_smiling_face:

If anyone has any additional questions, please let me know; hope that helps!

  • Leo

“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.