Well, the problem is a really old one. The XML files for the shows for Ted Talks/VideoPlayer example are set to a value of "TALK" which isn't valid.
Set it to episode and you'll get your ratings.
Maybe some day they'll update the example scripts to fix mistakes like these.
Here's your channel that shows ratings:
http://hotfile.com/dl/126745271/5a984c7 ... r.zip.htmlThis is what I changed
in Showfeed.brs
Function init_show_feed_item() As Object
o = CreateObject("roAssociativeArray")
o.ContentId = ""
o.Title = ""
o.ContentType = ""
o.ContentQuality = ""
o.Synopsis = ""
o.Genre = ""
o.Runtime = ""
o.Rating = "PG-13" -- add this rating manually since a rating field isn't in the xml files it downloads
o.StreamQualities = CreateObject("roArray", 5, true)
o.StreamBitrates = CreateObject("roArray", 5, true)
o.StreamUrls = CreateObject("roArray", 5, true)
return o
End Function
Function parse_show_feed(xml As Object, feed As Object) As Void
showCount = 0
showList = xml.GetChildElements()
for each curShow in showList
'for now, don't process meta info about the feed size
if curShow.GetName() = "resultLength" or curShow.GetName() = "endIndex" then
goto skipitem
endif
item = init_show_feed_item()
'fetch all values from the xml for the current show
item.hdImg = validstr(curShow@hdImg)
item.sdImg = validstr(curShow@sdImg)
item.ContentId = validstr(curShow.contentId.GetText())
item.Title = validstr(curShow.title.GetText())
item.Description = validstr(curShow.description.GetText())
item.ContentType = validstr(curShow.contentType.GetText()) Might as well remove this since the xml files it downloads list an invalid value of "TALK" - see page 15 of the component reference
'I left a placeholder for it if you come up with xml files later with <rating> and </rating> in them
item.ContentQuality = validstr(curShow.contentQuality.GetText())
item.Synopsis = validstr(curShow.synopsis.GetText())
item.Genre = validstr(curShow.genres.GetText())
item.Runtime = validstr(curShow.runtime.GetText())
item.HDBifUrl = validstr(curShow.hdBifUrl.GetText())
item.SDBifUrl = validstr(curShow.sdBifUrl.GetText())
item.StreamFormat = validstr(curShow.streamFormat.GetText())
if item.StreamFormat = "" then 'set default streamFormat to mp4 if doesn't exist in xml
item.StreamFormat = "mp4"
endif
'map xml attributes into screen specific variables
item.ShortDescriptionLine1 = item.Title
item.ShortDescriptionLine2 = item.Description
item.HDPosterUrl = item.hdImg
item.SDPosterUrl = item.sdImg
item.Length = strtoi(item.Runtime)
item.Categories = CreateObject("roArray", 5, true)
item.Categories.Push(item.Genre)
item.Actors = CreateObject("roArray", 5, true)
item.Actors.Push(item.Genre)
item.Description = item.Synopsis
'Set Default screen values for items not in feed
item.HDBranded = false
item.IsHD = false
item.StarRating = "90"
item.ContentType = "episode" ContentType String ----- Valid values = movie, episode, season, series, audio. Missing attribute = NotSet
And in AppDetailScreen.brs
Function preShowDetailScreen(breadA=invalid, breadB=invalid) As Object
port=CreateObject("roMessagePort")
screen = CreateObject("roSpringboardScreen")
screen.SetDescriptionStyle("video") - A video description style will not show any set MPAA ratings. Change this to Episode (for a square SD/HDposter image) or Video (for a rectangle SD/HDposter image) and ratings display
screen.SetMessagePort(port)
if breadA<>invalid and breadB<>invalid then
screen.SetBreadcrumbText(breadA, breadB)
end if
return screen
End Function
SetDescriptionStyle(String style)
“video”: All tags except <Directors> and <Ratings> that are on the video screen above are replaced with Content Meta-Data.