For some reason, I cant play this code
' *********************************************************
' ** Simple Grid Screen Demonstration App
' ** Jun 2010
' ** Copyright (c) 2010 Roku Inc. All Rights Reserved.
' *********************************************************
'************************************************************
'** Application startup
'************************************************************
Function ShowBonanzaMenu() as integer
screen = CreateObject("roGridScreen")
port = CreateObject("roMessagePort")
screen.SetMessagePort(port)
screen.SetContentList(InitMovieList())
screen.SetFocusedListItem(4)
screen.Show()
while (true)
msg = wait(0, port)
if type(msg) = "roGridScreenEvent"
if (msg.isScreenClosed())
return -1
else if (msg.isListItemSelected())
ShowDetailsScreen( msg.GetIndex() )
endif
endif
end while
End Function
Function ShowDetailsScreen(index as integer) as integer
print "Selected Index: " + Stri(index)
detailsScreen = CreateObject("roSpringboardScreen")
port = CreateObject("roMessagePort")
detailsScreen.SetMessagePort(port)
detailsScreen.SetDescriptionStyle("generic")
detailsScreen.SetBreadcrumbText("Bonanza", options[index].Description)
detailsScreen.SetStaticRatingEnabled(false)
details = {
HDPosterUrl: options[index].HDPosterURL
SDPosterUrl: options[index].SDPosterURL
Description: options[index].Description
}
detailsScreen.SetContent(details)
detailsScreen.AddButton(1, "Play Movie")
detailsScreen.show()
while (true)
msg = wait(0, port)
if type(msg) = "roSpringboardScreenEvent"
if (msg.isScreenClosed())
return -1
else if (msg.isButtonPressed())
DetailsScreenButtonClicked( msg.GetIndex() )
endif
endif
end while
End Function
Function DetailsScreenButtonClicked(index as integer) as void
dialog = CreateObject("roOneLineDialog")
if (index = 1)
PlayVideo()
endif
dialog.ShowBusyAnimation()
dialog.show()
Sleep(4000)
End Function
'********************************************************************
'** Given the category from the filter banner, return an array
'** of ContentMetaData objects (roAssociativeArray's) representing
'** the shows for the category. For this example, we just cheat and
'** create and return a static array with just the minimal items
'** set, but ideally, you'd go to a feed service, fetch and parse
'** this data dynamically, so content for each category is dynamic
'********************************************************************
Function InitEpisodeList(category As Object) As Object
print "getting shows for category "; category
options = [
{
Title: category + ": Bitter Water",
releaseDate: "",
rating: "",
Description:"The Cartwrights find themselves involved in a fight over water rights, when the son of one of their neighbors is influenced by the father of his fiancee. Lem Keith wants to destroy the Ponderosa and will stop at nothing including infecting Ponderosa cattle with his own diseased cattle. This leads the Cartwrights to take measures that they never thought they would use.",
HDPosterUrl:"",
SDPosterUrl:"",
StarRating:100
}
{
Title: category + ": Blood On The Land",
releaseDate: "",
rating: "",
Description:"A sheepherder and his men try to drive their sheep across the Ponderosa. Ben and Adam disagree about how to stop them. Ben wants the Cartwrights to handle their own matters, Adam wants to let the law handle the situation. After Adam is taken hostage, Ben starts to see things Adam's way.",
HDPosterUrl:"",
SDPosterUrl:"",
StarRating:100
}
{
Title: category + ": Dark Star",
releaseDate: "",
rating: "",
Description:"Joe is about to shoot what he thinks is a wolf and discovers it is a woman. The woman turns out to be a gypsy, who her people think is possessed by the devil. Joe falls in love and she is taken in by the Cartwrights after her family shuns her. Joe is determined to find out what is really going on behind the strange happenings that are blamed on the woman.",
HDPosterUrl:"",
SDPosterUrl:"",
StarRating:100
}
{
Title: category + ": Death At Dawn",
releaseDate: "",
rating: "",
Description:"The town is being run by bad guys and the Cartwrights decide it has to stop. When a local merchant is gunned down for refusing to pay protection, Farmer Perkins is tried and sentenced to hang. Ben is taken hostage by Perkins' employer, with threats to hang Ben if Farmer is not released. ",
HDPosterUrl:"",
SDPosterUrl:"",
StarRating:100
}
]
return options
End Function
Function PlayVideo()
theUrl = invalid
if (index = 0) then
theUrl = "https://archive.org/download/Bonanza-BitterWater/Bonanza_Bitter_Water_S01-E29_512kb.mp4"
else if (index = 1) then
theUrl = "https://archive.org/download/Bonanza-BloodOnTheLand/Bonanza_-_Blood_On_The_Land_S01-E22_512kb.mp4"
else if (index = 2) then
theUrl = "https://archive.org/download/Bonanza-DarkStar/Bonanza_-_Dark_Star_S01-E31_512kb.mp4"
else if (index = 3) then
theUrl = "https://archive.org/download/Bonanza-DeathAtDawn/Bonanza_-_Death_At_Dawn_S01-E32_512kb.mp4"
else
print "Invalid index"
theUrl = invalid
end if
if (theUrl <> invalid) then
videoContent = {
streamFormat: "mp4",
stream: {
url: theUrl
}
}
PlayContentWithFullRAFIntegration(videoContent)
else
' Some error-handling code?
end if
End Function
Because of this error:
SUB or FUNCTION defined twice
(34) 'ShowDetailsScreen'
Is there any way to fix this?