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: 

2 Levels of Category

Hi,

I am not very experienced with programming Roku channels. I created 2 channels with a template from the ROKU website (Video Player Example Application), but now I have to create another channel that requires 2 levels + the level where all the videos are.

So here is what the channel should look like:



I have 3 XML files
1. Level would be for Category 1, Category 2
2. Level would be for Category 1-1, Category 2-1,...
3. Level would be for the actual content, the videos.

The first Level XML:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<categories>
<category title="Truths That Transform"
description="A TV Program produced by D James Kennedy Ministries"
sd_img="http://djkm-roku.s3.amazonaws.com/toplevelposters/TTT-TopLevelCategory_224x258.jpg"
hd_img="http://djkm-roku.s3.amazonaws.com/toplevelposters/TTT-TopLevelCategory_304x237.jpg">
<categoryLeaf title="Program" description="Truths That Transform"
feed="http://djkm-roku.s3.amazonaws.com/ttt/xml/ttt-year.xml" />
</category>
<category title="Kennedy Classics"
description="A TV Program produced by D James Kennedy Ministries"
sd_img="http://djkm-roku.s3.amazonaws.com/toplevelposters/KC-TopLevelCategory_224x158.jpg"
hd_img="http://djkm-roku.s3.amazonaws.com/toplevelposters/KC-TopLevelCategory_304x237.jpg">
<categoryLeaf title="Program" description="Kennedy Classics"
feed="http://djkm-roku.s3.amazonaws.com/kc/xml/kc-year.xml" />
</category>

</categories>



2. Level XML:

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

<category title="Kennedy Classics 2015"
description="A TV Program produced by D James Kennedy Ministries"
sd_img="http://s3.amazonaws.com/djkm-roku/kc/poster/SD_CategoryPoster-2015_285x145.jpg"
hd_img="http://s3.amazonaws.com/djkm-roku/kc/poster/HD_CategoryPoster-2015_385x218.jpg">
<categoryLeaf title="2015" description="Kennedy Classics 2015"
feed="http://djkm-roku.s3.amazonaws.com/ttt/xml/ttt-program_2015.xml" />
</category>

</categories>



3. Level XML:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed>
<!-- resultLength indicates the total number of results for this feed -->
<resultLength>45</resultLength>
<!-- endIndix indicates the number of results for this *paged* section of
the feed -->
<endIndex>45</endIndex>
<item
sdImg="http://s3.amazonaws.com/tiamroku/posters/sd/SD_KC1545_ListPoster_177x90.jpg"
hdImg="http://s3.amazonaws.com/tiamroku/posters/hd/HD_KC1545_ListPoster_269x152.jpg">
<title>Christ and Christ Alone</title>
<titleseason>Great Truths of Faith</titleseason>
<contentId>kc1545</contentId>
<contentType>episode</contentType>
<contentQuality>HD</contentQuality>
<media>
<streamFormat>mp4</streamFormat>
<streamQuality>HD</streamQuality>
<streamBitrate>3100</streamBitrate>
<streamUrl>http://kennedyclassics.s3.amazonaws.com/2015/KC20151107.mp4</streamUrl>
</media>
<synopsis>We live in a time of vast government overreach in part because Christians have forgotten the truth and bought into the lies of humanism. Rather than holding a biblical view of government, too many Christians have stood with their neighbors in calling for a government savior. Dr. D. James Kennedy was on the forefront of warning Christians to beware of putting government in God’s place.</synopsis>
<genres>Religious</genres>
<runtime>1710</runtime>
</item>
</feed>



If I use Level 2 as my started level everything works fine. If I add level 1 on top of it, I can display level 2, but after that nothing happens anymore. I assume that the code is expecting the feed after the first category. So how can I change the code that I can go from 1 Category to the 2 Category and then to the feed?

Thanks for your help


Charlie
0 Kudos
2 REPLIES 2
belltown
Roku Guru

Re: 2 Levels of Category

The Roku SDK videoplayer example does not handle a three-level hierarchy. However, the NewVideoPlayer example does. See this post for details: http://forums.roku.com/viewtopic.php?f=34&t=91672&p=516080

To get your channel working, put the following in the pkg:/xml/categories.xml file:


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

<category title="Truths That Transform"
description="A TV Program produced by D James Kennedy Ministries"
sd_img="http://djkm-roku.s3.amazonaws.com/toplevelposters/TTT-TopLevelCategory_224x258.jpg"
hd_img="http://djkm-roku.s3.amazonaws.com/toplevelposters/TTT-TopLevelCategory_304x237.jpg">

<categoryLeaf title="Kennedy Classics 2013"
description="A TV Program produced by D James Kennedy Ministries"
sd_img="http://s3.amazonaws.com/djkm-roku/kc/poster/SD_CategoryPoster-2015_285x145.jpg"
hd_img="http://s3.amazonaws.com/djkm-roku/kc/poster/HD_CategoryPoster-2015_385x218.jpg"
feed="http://s3.amazonaws.com/djkm-roku/kc/xml/kc-program_2015.xml"/>
<categoryLeaf title="Kennedy Classics 2014"
description="A TV Program produced by D James Kennedy Ministries"
sd_img="http://s3.amazonaws.com/djkm-roku/kc/poster/SD_CategoryPoster-2015_285x145.jpg"
hd_img="http://s3.amazonaws.com/djkm-roku/kc/poster/HD_CategoryPoster-2015_385x218.jpg"
feed="http://s3.amazonaws.com/djkm-roku/kc/xml/kc-program_2015.xml"/>
<categoryLeaf title="Kennedy Classics 2015"
description="A TV Program produced by D James Kennedy Ministries"
sd_img="http://s3.amazonaws.com/djkm-roku/kc/poster/SD_CategoryPoster-2015_285x145.jpg"
hd_img="http://s3.amazonaws.com/djkm-roku/kc/poster/HD_CategoryPoster-2015_385x218.jpg"
feed="http://s3.amazonaws.com/djkm-roku/kc/xml/kc-program_2015.xml"/>
</category>

<category title="Kennedy Classics"
description="A TV Program produced by D James Kennedy Ministries"
sd_img="http://djkm-roku.s3.amazonaws.com/toplevelposters/KC-TopLevelCategory_224x158.jpg"
hd_img="http://djkm-roku.s3.amazonaws.com/toplevelposters/KC-TopLevelCategory_304x237.jpg">

<categoryLeaf title="Kennedy Classics 2013"
description="A TV Program produced by D James Kennedy Ministries"
sd_img="http://s3.amazonaws.com/djkm-roku/kc/poster/SD_CategoryPoster-2015_285x145.jpg"
hd_img="http://s3.amazonaws.com/djkm-roku/kc/poster/HD_CategoryPoster-2015_385x218.jpg"
feed="http://s3.amazonaws.com/djkm-roku/kc/xml/kc-program_2015.xml"/>
<categoryLeaf title="Kennedy Classics 2014"
description="A TV Program produced by D James Kennedy Ministries"
sd_img="http://s3.amazonaws.com/djkm-roku/kc/poster/SD_CategoryPoster-2015_285x145.jpg"
hd_img="http://s3.amazonaws.com/djkm-roku/kc/poster/HD_CategoryPoster-2015_385x218.jpg"
feed="http://s3.amazonaws.com/djkm-roku/kc/xml/kc-program_2015.xml"/>
<categoryLeaf title="Kennedy Classics 2015"
description="A TV Program produced by D James Kennedy Ministries"
sd_img="http://s3.amazonaws.com/djkm-roku/kc/poster/SD_CategoryPoster-2015_285x145.jpg"
hd_img="http://s3.amazonaws.com/djkm-roku/kc/poster/HD_CategoryPoster-2015_385x218.jpg"
feed="http://s3.amazonaws.com/djkm-roku/kc/xml/kc-program_2015.xml"/>
</category>

</categories>



Then go to the source/UITheme.brs file to specify the locations of your artwork/logos, etc.
0 Kudos

Re: 2 Levels of Category

Thank you so much belltown. your code was so easy to adopt and apply to our purpose it was unbelievable.
I really appreciate what you have done, not only for the ROKU community, but even more for my sanity ... HaHa.

God Bless you.
0 Kudos