Function showHomeScreen(screen) As Integer
if validateParam(screen, "roPosterScreen", "showHomeScreen") = false return -1
initCategoryList()
screen.SetContentList(m.Categories.Kids)
screen.SetFocusedListItem(0)
screen.Show()
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roPosterScreenEvent" then
print "showHomeScreen | msg = "; msg.GetMessage() " | index = "; msg.GetIndex()
if msg.isListFocused() then
print "list focused | index = "; msg.GetIndex(); " | category = "; m.curCategory
else if msg.isListItemSelected() then
print "list item selected | index = "; msg.GetIndex()
kid = m.Categories.Kids[msg.GetIndex()]
if kid.type = "About Us" then
ShowParagraphScreen()
else if kid.type = "Hope Point Live Stream" then
' method 1: hard code the stream here in the channel
' init the video item now and go to video:
item = init_show_feed_item()
item.StreamBitrates.Push(2000)
item.StreamQualities.Push("SD")
item.StreamFormat = "hls"
item.StreamUrls.Push(validstr("http://www.yourstreamlive.com/live/901/hls"))
showVideoScreen(item)
else if kid.Title = "Hope Point Live Stream"
' method 2: key it off some element in the xml so you can update the stream later
' try to get the video item from the kid's xml and play it now
shows = getShowsForCategoryItem(kid, 0)
showVideoScreen(shows[0])
else
displayCategoryPosterScreen(kid)
end if
else if msg.isScreenClosed() then
return -1
end if
end If
end while
return 0
End Function
"hpdean" wrote:
I am a beginner with this and I need help! I am switching live streaming services. We only stream our service once a week, so for the majority of the time, our live stream is not active. My previous stream host streamed an offline loop to the HLS stream, however, my new stream host does not do this. I need to see if there is any way to do this within the roku code. Here is how my current live stream is hard coded into the channel:Function showHomeScreen(screen) As Integer
if validateParam(screen, "roPosterScreen", "showHomeScreen") = false return -1
initCategoryList()
screen.SetContentList(m.Categories.Kids)
screen.SetFocusedListItem(0)
screen.Show()
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roPosterScreenEvent" then
print "showHomeScreen | msg = "; msg.GetMessage() " | index = "; msg.GetIndex()
if msg.isListFocused() then
print "list focused | index = "; msg.GetIndex(); " | category = "; m.curCategory
else if msg.isListItemSelected() then
print "list item selected | index = "; msg.GetIndex()
kid = m.Categories.Kids[msg.GetIndex()]
if kid.type = "About Us" then
ShowParagraphScreen()
else if kid.type = "Hope Point Live Stream" then
' method 1: hard code the stream here in the channel
' init the video item now and go to video:
item = init_show_feed_item()
item.StreamBitrates.Push(2000)
item.StreamQualities.Push("SD")
item.StreamFormat = "hls"
item.StreamUrls.Push(validstr("http://www.yourstreamlive.com/live/901/hls"))
showVideoScreen(item)
else if kid.Title = "Hope Point Live Stream"
' method 2: key it off some element in the xml so you can update the stream later
' try to get the video item from the kid's xml and play it now
shows = getShowsForCategoryItem(kid, 0)
showVideoScreen(shows[0])
else
displayCategoryPosterScreen(kid)
end if
else if msg.isScreenClosed() then
return -1
end if
end If
end while
return 0
End Function
Is it possible to have a fallback image or something, that tells the channel to check the HLS stream first and then fall back to image if no stream is active?
Sorry , do you have the complate solution sample zip file , it will help me alot
thanks