function createRow(list as object, num as Integer)
print "Parser.brs - [createRow]"
Parent = createObject("RoSGNode", "ContentNode")
row = createObject("RoSGNode", "ContentNode")
row.Title = list[num].Title
for each itemAA in list[num].ContentList
item = createObject("RoSGNode","ContentNode")
AddAndSetFields(item, itemAA)
row.appendChild(item)
end for
Parent.appendChild(row)
return Parent
end function
function createRow(list as object, num as Integer)
print "Parser.brs - [createRow]"
Parent = createObject("RoSGNode", "ContentNode")
row = createObject("RoSGNode", "ContentNode")
row.Title = list[num].Title
fullRow = []
for each itemAA2 in list[num].ContentList
item2 = createObject("RoSGNode","ContentNode")
AddAndSetFields(item2, itemAA2)
fullRow.push(item2)
end for
for each itemAA in list[num].ContentList
item = createObject("RoSGNode","ContentNode")
AddAndSetFields(item, itemAA)
for each childRow in fullRow
item.appendChild(childRow)
end for
row.appendChild(item)
end for
Parent.appendChild(row)
return Parent
end function
<Video
id="VideoPlayer"
visible="false"
translation="[0, 0]"
width="1920"
height="1080"
contentIsPlaylist="true"
/>
1. Set the content field to a ContentNode node containing a child ContentNode node for each media item in the playlist.
2. Set the contentIsPlaylist field to true.
function createRow(list as object, num as Integer)
print "Parser.brs - [createRow]"
Parent = createObject("RoSGNode", "ContentNode")
row = createObject("RoSGNode", "ContentNode")
row.Title = list[num].Title
fullContentList = list[num].ContentList
for each itemAA in fullContentList
Playlist = createObject("RoSGNode", "ContentNode")
Playlist.title = itemAA.title
Playlist.description = itemAA.description
Playlist.hdposterurl = itemAA.hdposterurl
Playlist.sdposterurl = itemAA.sdposterurl
Playlist.hdBackgroundImageUrl = itemAA.hdBackgroundImageUrl
for each itemAA2 in fullContentList
item2 = createObject("RoSGNode","ContentNode")
AddAndSetFields(item2, itemAA2)
Playlist.appendChild(item2)
end for
row.appendChild(Playlist)
end for
Parent.appendChild(row)
return Parent
end function
'Create a row of content '
function createRow(list as object, num as Integer)
print "Parser.brs - [createRow]"
Parent = createObject("RoSGNode", "ContentNode")
row = createObject("RoSGNode", "ContentNode")
row.Title = list[num].Title
fullContentList = list[num].ContentList
' Clone the content list '
copyContentList = []
for each thingToClone in fullContentList
copyContentList.push(thingToClone)
end for
' Loop through the content list to create a single video node '
for each itemAA in fullContentList
Playlist = createObject("RoSGNode", "ContentNode")
Playlist.title = itemAA.title
Playlist.description = itemAA.description
Playlist.hdposterurl = itemAA.hdposterurl
Playlist.sdposterurl = itemAA.sdposterurl
Playlist.hdBackgroundImageUrl = itemAA.hdBackgroundImageUrl
' Loop through the cloned content list, to create the playlist of other vids in the category '
for each itemAA2 in copyContentList
item2 = createObject("RoSGNode","ContentNode")
item2.url = itemAA2.url
Playlist.appendChild(item2)
end for
' Remove the first item in the list and put it at the end. '
' This makes the 1st video in the playlist the one thats showing its title '
shiftedItem = copyContentList.shift()
copyContentList.push(shiftedItem)
row.appendChild(Playlist)
end for
Parent.appendChild(row)
return Parent
end function