how can i load data from a json file through a task node instead of loading it in mainscene brs?
Take a look at this code from the Roku community sample projects. It does exactly what you're asking.
this is when im using a rowlist right?
sub createRowItems(json as Object, listContent as Object)
for each postDataContainer in json.data.children
postData = postDataContainer.data
post = {
title: postData.title,
selfText: postData.selfText,
thumbnail: postData.thumbnail,
isVideo: postData.is_video,
url: postData.url,
isSelf: postData.isSelf
}
if post.isVideo then
itemContent = listContent.createChild("ContentNode")
itemContent.update({ isSelf: post.isSelf }, true)
itemContent.title = post.title
itemContent.description = post.selfText
itemContent.url = post.url
if post.thumbnail <> "self" and post.thumbnail <> "default" and post.thumbnail <> "image" then
itemContent.SDPosterUrl = post.thumbnail
end if
if post.isVideo then
itemContent.url = post.url + "/DASHPlaylist.mpd"
itemContent.streamformat = "dash"
end if
if postData.media <> invalid and postData.media.type = "youtube.com" then
itemContent.videoUrl = postData.url
itemContent.streamFormat = "youtube"
end if
extension = right(postData.url, 4)
if extension = ".png" or extension = ".jpg" then
itemContent.SDPosterUrl = postData.url
end if
itemContent.update({
isRedditVideo: (postData.media <> invalid and postData.media.reddit_video <> invalid)
}, true)
end if
end for
end sub
i believe ill be using this part