Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is it possible to use roListscreen with rovideoplayer?

I am a newbie in Roku Development so please bear with me. I want to create a windowed video player along with a playlist on one screen. I want the playlist to be scrollable. My research so far has showed that for scrollable list I can use roListscreen and for video I can use rovideoplayer component.

But I am facing a problem when I try to use the both together. I am trying to display rovideoplayer on the right side of the screen using its SetDestRect method. But the videoplayer doesnot appear on the screen at all.

So my question is that Are these two components compatible at all?? If yes any example or link I can use.Any suggestions would be really appreciated.

Here is the script I am using:

'Library "v30/bslDefender.brs"
Function Main() as void
screen = CreateObject("roListScreen")
port = CreateObject("roMessagePort")
vport = CreateObject("roMessagePort")
player= CreateObject("roVideoPlayer")
screen.SetMessagePort(port)
InitTheme()
screen.SetHeader("Welcome to The Channel Diner")
screen.SetBreadcrumbText("Menu", "Breakfast")

contentList = InitContentList()
screen.SetContent(contentList)
player.SetMessagePort(vport)
player.SetLoop(true)
player.SetPositionNotificationPeriod(1)
player.SetDestinationRect({ x: 200, y: 100, w: 200, h: 210 })
player.SetContentList([{

Stream: { url: "http://sample.vodobox.net/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8" }
StreamFormat: "hls"
SwitchingStrategy: "full-adaptation"
}])
player.Play()

screen.show()

while (true)
msg = wait(0, port)
if (type(msg) = "roListScreenEvent")
if (msg.isListItemFocused())
screen.SetBreadcrumbText("Menu", contentList[msg.GetIndex()].Title)
endif
endif

end while
End Function

Function InitTheme() as void
app = CreateObject("roAppManager")

primaryText = "#FFFFFF"
secondaryText = "#707070"
'buttonText = "#C0C0C0"
'buttonHighlight = "#ffffff"
backgroundColor = "#e0e0e0"

theme = {
BackgroundColor: backgroundColor
OverhangSliceHD: "pkg:/images/Overhang_Slice_HD.png"
OverhangSliceSD: "pkg:/images/Overhang_Slice_HD.png"
OverhangLogoHD: "pkg:/images/channel_diner_logo.png"
OverhangLogoSD: "pkg:/images/channel_diner_logo.png"
OverhangOffsetSD_X: "25"
OverhangOffsetSD_Y: "15"
OverhangOffsetHD_X: "25"
OverhangOffsetHD_Y: "15"
BreadcrumbTextLeft: "#37491D"
BreadcrumbTextRight: "#E1DFE0"
BreadcrumbDelimiter: "#37491D"
'ThemeType: "generic-dark"
ListItemText: secondaryText
ListItemHighlightText: primaryText
ListScreenDescriptionText: secondaryText
ListItemHighlightHD: "pkg:/images/select_bkgnd.png"
ListItemHighlightSD: "pkg:/images/select_bkgnd.png"
}
app.SetTheme( theme )
End Function

Function InitContentList() as object
contentList = [
{
Title: "Breakfast",
ID: "1",
SDSmallIconUrl: "pkg:/images/breakfast_small.png",
HDSmallIconUrl: "pkg:/images/breakfast_small.png",
HDBackgroundImageUrl: "pkg:/images/breakfast_large.png",
SDBackgroundImageUrl: "pkg:/images/breakfast_large.png",
ShortDescriptionLine1: "Breakfast Menu",
ShortDescriptionLine2: "Select from our award winning offerings"
},
{
Title: "Lunch",
ID: "2",
SDSmallIconUrl: "pkg:/images/lunch_small.png",
HDSmallIconUrl: "pkg:/images/lunch_small.png",
HDBackgroundImageUrl: "pkg:/images/lunch_large.png",
SDBackgroundImageUrl: "pkg:/images/lunch_large.png",
ShortDescriptionLine1: "Lunch Menu",
ShortDescriptionLine2: "Eating again already?"
},
{
Title: "Dinner",
ID: "3",
SDSmallIconUrl: "pkg:/images/dinner_small.png",
HDSmallIconUrl: "pkg:/images/dinner_small.png",
HDBackgroundImageUrl: "pkg:/images/dinner_large.png",
SDBackgroundImageUrl: "pkg:/images/dinner_large.png",
ShortDescriptionLine1: "Dinner Menu",
ShortDescriptionLine2: "Chicken or Fish?"
},
{
Title: "Desserts",
ID: "4",
SDSmallIconUrl: "pkg:/images/dessert_small.png",
HDSmallIconUrl: "pkg:/images/dessert_small.png",
HDBackgroundImageUrl: "pkg:/images/dessert_large.png",
SDBackgroundImageUrl: "pkg:/images/dessert_large.png",
ShortDescriptionLine1: "Dessert Menu",
ShortDescriptionLine2: "Something for your sweet tooth"
},
{
Title: "Contact The Diner",
ID: "5",
SDSmallIconUrl: "pkg:/images/about_small.png",
HDSmallIconUrl: "pkg:/images/about_small.png",
HDBackgroundImageUrl: "pkg:/images/about_large.png",
SDBackgroundImageUrl: "pkg:/images/about_large.png",
ShortDescriptionLine1: "The Channel Diner",
ShortDescriptionLine2: "Phone: 1-(111)-111-1111"
}
]
return contentList
End Function
0 Kudos