Your Digital Media Has Never Looked So Good

 
koshermetal
Posts: 18
Joined: Sat Oct 29, 2011 1:13 am
Location: United States
Contact:

Re: XML - Categories/Levels Question

Wed Nov 16, 2011 11:06 am

Still having problems figuring this out.

Anyone have any suggestions on how to make the categories on the Channel appear from right to left instead of left to right? It automatically goes to the left-most category when loaded....what is the fix?

Thanks in advance for the help!
Free 24/7 Metal radio via web or smartphone
www.koshermetal.com
 
koshermetal
Posts: 18
Joined: Sat Oct 29, 2011 1:13 am
Location: United States
Contact:

Re: XML - Categories/Levels Question

Wed Nov 16, 2011 11:22 am

koshermetal wrote:
Still having problems figuring this out.

Anyone have any suggestions on how to make the categories on the Channel appear from right to left instead of left to right? It automatically goes to the left-most category when loaded....what is the fix?

Thanks in advance for the help!


Scratch that....I figured it out. I'm a stupid!
Free 24/7 Metal radio via web or smartphone
www.koshermetal.com
 
destruk
Posts: 2720
Joined: Sat Dec 18, 2010 4:58 pm

Re: XML - Categories/Levels Question

Wed Nov 16, 2011 3:25 pm

I don't think you're stupid. You figured it out, so that's great. :)
 
edunn@lifeminute.tv
Posts: 17
Joined: Tue Oct 25, 2011 1:44 pm

Re: XML - Categories/Levels Question

Tue Dec 27, 2011 1:57 pm

joetesta wrote:
The other day I started with a fresh SDK & went through this and confirmed that it is correct / successfully removes the leafs. The ONLY thing I left out is that you need to update your XML to include a 'feed' for the top level 'category' elements.
cheers,
Joe


I made all the changes you listed, but I'm still not able to get this to work. The app will start, but my feeds are returning blank.

It reads my categories.xml file, but isn't passing the subcategories or their video items.

Through the debugger It says

"created feed connection for url:
Request time:3
can't parse feed"

This is really stumping me. I'm thinking it could be Function get_category_names(categories As Object) As Dynamic in categoryFeed.brs since that seems to be one of the last functions that still refers to the "categories.kids", but I'm at a loss as to how to change it.

Any additional advice would be immensely appreciated.Thanks so much,
Evan
Last edited by edunn@lifeminute.tv on Tue Dec 27, 2011 2:40 pm, edited 1 time in total.
 
User avatar
RokuMarkn
Roku Engineering
Posts: 1581
Joined: Mon Jun 09, 2008 9:20 am

Re: XML - Categories/Levels Question

Tue Dec 27, 2011 2:12 pm

Well, one problem is you have an unescaped ampersand in the "Home & Family" string, so your XML is not well-formed. An XML validator like http://www.w3schools.com/xml/xml_validator.asp will help you find problems like this.

--Mark
 
edunn@lifeminute.tv
Posts: 17
Joined: Tue Oct 25, 2011 1:44 pm

Re: XML - Categories/Levels Question

Tue Dec 27, 2011 2:19 pm

Sorry, that was the browser interperation, The ampersand is escaped.

I was able to get my app to function 100% correctly when it was using leafs, so it's really not a quality-of-feed issue.

I have my root feed at categories.xml which leads to a separate feed for each category. Using the video player example, it wants to put that horizontal menu between the category listing on the splash screen and the list of episodes underneath each category. I can't get my app approved until I figure out a way to remove that extra click people have to go through to get to the episodes.
Last edited by edunn@lifeminute.tv on Tue Dec 27, 2011 2:40 pm, edited 1 time in total.
 
edunn@lifeminute.tv
Posts: 17
Joined: Tue Oct 25, 2011 1:44 pm

Re: XML - Categories/Levels Question

Tue Dec 27, 2011 2:39 pm

Aha! Solved.

Thanks so much for all your help!!

The problem turned out that I was applying the o.Feed = xml@feed to the wrong case in CategoryFeed.brs.

It needs to be under "if xml.GetName() = "category" then" instead of "elseif xml.GetName() = "specialCategory" then"

Of course!! Well, dunce cap me in the corner for how long that took me to figure out.

Again, whole-hearted thanks to everyone in this thread who kept me at it until I got it.
 
agmark
Posts: 142
Joined: Thu Nov 10, 2011 8:29 am

Re: XML - Categories/Levels Question

Fri Jan 13, 2012 11:10 pm

Sorry to dig up an older thread, but can anyone explain how the an XML file should look like when we include a feed for the top level category? I have a simple categories.xml and one "channels.xml" containing the <feed></feed> which contains <item>s. I assume I cut and paste this metadata into the categories file, but I don't know what the format should look like. I need to remove the unneeded leafs and simplify the UI and it sounds like Joe's edits will do that.

joetesta wrote:
edunn@lifeminute.tv wrote:
So have these modifications been successful for anyone? I tried applying them to my app, and it came up with a number of syntax errors in appHomeScreen.brs

I'd really like to get those subcategories out of there. I'm wondering if I made a mistake of my own somewhere...

Thanks so much everyone.


Hi there - see my post here: http://forums.roku.com/viewtopic.php?f=34&t=26563#p304237
The other day I started with a fresh SDK & went through this and confirmed that it is correct / successfully removes the leafs. The ONLY thing I left out is that you need to update your XML to include a 'feed' for the top level 'category' elements.
cheers,
Joe
 
joetesta
Posts: 790
Joined: Wed Apr 20, 2011 11:48 am

Re: XML - Categories/Levels Question

Fri Jan 27, 2012 3:23 pm

Hi agmark -

You will have an XML file for the top level categories like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<categories>
        <category title="Category1" description="The first Category"
                  sd_img="http://www.##EXAMPLE##.com/images/category1_sd.png"
                  hd_img="http://www.##EXAMPLE##.com/images/category1_hd.png"
                  feed="http://www.##EXAMPLE##.com/feeds/category1.xml" >
        </category>
        <category title="Category2" description="The next Category"
                  sd_img="http://www.##EXAMPLE##.com/images/category2_sd.png"
                  hd_img="http://www.##EXAMPLE##.com/images/category2_hd.png"
                  feed="http://www.##EXAMPLE##.com/feeds/category2.xml" >
        </category>
 </categories>



The application should call the URL of that XML file. Then for each category listed in that file, you will have other XML files such as category1.xml, category2.xml etc and in my case those look like this:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<feed>
 <item sdImg="http://www.##EXAMPLE##.com/Global/images/167970.jpg" hdImg="http://www.##EXAMPLE##.com/Global/images/167970.jpg">
                <title>My first Title</title>
                <contentId>167970</contentId>
                <ContentType>movie</ContentType>
                <contentQuality>SD</contentQuality>
                <streamFormat>mp4</streamFormat>
                <media>
                        <streamQuality>SD</streamQuality>
                        <streamBitrate>600</streamBitrate>
                        <streamUrl>https://secure.##EXAMPLE##.com/167970_600.mp4</streamUrl>
                </media>
                <media>
                        <streamQuality>SD</streamQuality>
                        <streamBitrate>2500</streamBitrate>
                        <streamUrl>https://secure.##EXAMPLE##.com/167970_2500.mp4</streamUrl>
                </media>
                <synopsis>The first movie in my list</synopsis>
                <actors>Starring: some really cool actors!</actors>
                <director>Bob</director>
                <releasedate>Released: 2008</releasedate>
                <runtime>8500</runtime>
                <hdBifUrl>http://www.##EXAMPLE##.com/167970/bif_hd.bif</hdBifUrl>
                <sdBifUrl>http://www.##EXAMPLE##.com/167970/bif_sd.bif</sdBifUrl>
        </item>
</feed>


I hope this helps!
-joe
aspiring
 
radargaming
Posts: 11
Joined: Mon Mar 11, 2013 2:14 pm

Re: XML - Categories/Levels Question

Sun Jun 16, 2013 7:24 am

Ok not trying to dig up an OLD thread but I have tested this on 3 new samplevideo player app and they all dont work. Can anyone confirm that this still works?
 
joetesta
Posts: 790
Joined: Wed Apr 20, 2011 11:48 am

Re: XML - Categories/Levels Question

Mon Jun 17, 2013 2:17 pm

What's going wrong, did you telnet to your roku's debug and see where it's failing?
Update: there was one correction to the code I posted earlier; complete correct instructions can be found here viewtopic.php?f=34&t=57936
aspiring

Who is online

Users browsing this forum: No registered users and 9 guests