I keep getting these errors:
Syntax Error. (compile error &h02) in pkg:/source/Searchscreen.brs(224)
Syntax Error. (compile error &h02) in pkg:/source/Searchscreen.brs(225)
Syntax Error. (compile error &h02) in pkg:/source/Searchscreen.brs(226)
Syntax Error. (compile error &h02) in pkg:/source/Searchscreen.brs(227)
Syntax Error. (compile error &h02) in pkg:/source/Searchscreen.brs(228)
Line 224 is the "if IsHD() then" statement.
init_show_feed_item() creates the associative array and StremQualities is an roarray inside of the associative array just like the videoplayer example.
IsHD() returns a Boolean.
Function IsHD()
di = CreateObject("roDeviceInfo")
if di.GetDisplayType() = "HDTV" then return true
return false
End Function
Function searchfeedparse(xml As Object, feed As Object) As Object
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.HDImage.GetText())
item.sdImg = validstr(curShow.SDImage.GetText())
item.ContentId = validstr(curShow.ID.GetText())
item.Title = validstr(curShow.Title.GetText())
item.Description = validstr(curShow.Description.GetText())
item.Category = validstr(curShow.Category.GetText())
item.ContentType = validstr(curShow.Type.GetText())
item.ContentQuality = validstr(curShow.ContentQuality.GetText())
item.Synopsis = validstr(curShow.Description.GetText())
item.Genre = validstr(curShow.genres.GetText())
item.Meta = validstr(curShow.Meta.GetText())
item.Runtime = validstr(curShow.Length.GetText())
item.ImageCount = strtoi(validstr(curShow.ImageCount.GetText()))
item.Date = validstr(curShow.Date.GetText())
item.Url = validstr(curShow.Url.GetText())
item.HDBifUrl = validstr(curShow.hdBifUrl.GetText())
item.SDBifUrl = validstr(curShow.sdBifUrl.GetText())
item.StreamFormat = validstr(curShow.Format.GetText())
item.StreamBitrates.Push(strtoi(validstr(curShow.streamBitrate.GetText())))
'will set streamqualities automatically later
'item.StreamQualities.Push(validstr(curShow.streamQuality.GetText()))
item.StreamUrls.Push(validstr(curShow.strealUrl.GetText()))
if IsHD() then
item.StreamQualities.Push("HD")
else
item.StreamQualities.Push("SD")
end if
if item.StreamFormat = "" then 'set default streamFormat to mp4 if doesn't exist in xml
item.StreamFormat = "mp4"
endif
if item.StreamFromat = "text" then
item.Url = item.streamUrls
else
print "skip"
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 = "0"
if item.ContentType = "" then
item.ContentType = "episode"
endif
showCount = showCount + 1
feed.Push(item)
skipitem:
next
return feed
End Function