Install error

I have an install error when I tried to add this code on my channel

Function Main() as void
    m.menuFunctions = [
	PlayLiveFeed,
        CreateArchiveMenu
    ]
    screen = CreateObject("roListScreen")
    port = CreateObject("roMessagePort")
    screen.SetMessagePort(port)
    InitTheme()
    screen.SetHeader("Welcome to Griffin TV")
    screen.SetBreadcrumbText("Menu", "Archive")
    contentList = InitContentList()
    screen.SetContent(contentList)
    screen.show()
    while (true)
        msg = wait(0, port)
        if (type(msg) = "roListScreenEvent")
            if (msg.isListItemFocused())
                screen.SetBreadcrumbText("Menu", contentList[msg.GetIndex()].Title)
            else if (msg.isListItemSelected())
                m.menuFunctions[msg.GetIndex()]()
            endif      
        endif
    end while
End Function

Function InitTheme() as void
    app = CreateObject("roAppManager")
    
    listItemHighlight           = "#FFFFFF"
    listItemText                = "#707070"
    brandingGreen               = "#37491D"
    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: brandingGreen
        BreadcrumbTextRight: "#E1DFE0"
        BreadcrumbDelimiter: brandingGreen
        
        ListItemText: listItemText
        ListItemHighlightText: listItemHighlight
        ListScreenDescriptionText: listItemText
        ListItemHighlightHD: "pkg:/images/select_bkgnd.png"
        ListItemHighlightSD: "pkg:/images/select_bkgnd.png"
        CounterTextLeft: brandingGreen
        CounterSeparator: brandingGreen
        GridScreenBackgroundColor: backgroundColor
        GridScreenListNameColor: brandingGreen
        GridScreenDescriptionTitleColor: brandingGreen
        GridScreenLogoHD: "pkg://images/HDPoster.png"
        GridScreenLogoSD: "pkg://images/SDPoster.png"
        GridScreenOverhangHeightHD: "138"
        GridScreenOverhangHeightSD: "138"
        GridScreenOverhangSliceHD: "pkg:/images/Overhang_Slice_HD.png"
        GridScreenOverhangSliceSD: "pkg:/images/Overhang_Slice_HD.png"
        GridScreenLogoOffsetHD_X: "25"
        GridScreenLogoOffsetHD_Y: "15"
        GridScreenLogoOffsetSD_X: "25"
        GridScreenLogoOffsetSD_Y: "15"
    }
    app.SetTheme( theme )
End Function

Function InitContentList() as object
    contentList = [

        {
            Title: "Live",
            ID: "2",
            
            HDBackgroundImageUrl: "pkg:/images/lvstreaming_304x237.png",
            SDBackgroundImageUrl: "pkg:/images/lvstreaming_304x237.png",            
            ShortDescriptionLine1: "Live Broadcast",
            ShortDescriptionLine2: "Live events are shown here"  
			          
        },
        {
            Title: "Archive",
            ID: "3",
            
            HDBackgroundImageUrl: "pkg:/images/HDPoster.png",
            SDBackgroundImageUrl: "pkg:/images/SDPoster.png",            
            ShortDescriptionLine1: "Archive Menu",
            ShortDescriptionLine2: "Choose from a library of videos"            
        }

    ]
    return contentList
End Function

Is there any way to fix it?

Does it give you a line # for the error?

could it be the
while (true)
? Maybe that’s fine, but I don’t remember using ()

This code ran fine for me. Just installed it on a streaming stick (3500, SW 7.0b9044)

Hmm, then perhaps there’s a conflict with some other part of the code that is in the channel

“Komag” wrote:
Hmm, then perhaps there’s a conflict with some other part of the code that is in the channel

No, it says “Install Failure: Compilation Failed”. I have a 30" TCL Roku TV

Function Main() as void
    m.menuFunctions = [
        CreateLiveMenu,
        CreateArchivedMenu
    ]
    screen = CreateObject("roListScreen")
    port = CreateObject("roMessagePort")
    screen.SetMessagePort(port)
    InitTheme()
    screen.SetHeader("Welcome to Griffin TV")
    screen.SetBreadcrumbText("Live", "Archive")
    contentList = InitContentList()
    screen.SetContent(contentList)
    screen.show()
    while (true)
        msg = wait(0, port)
        if (type(msg) = "roListScreenEvent")
            if (msg.isListItemFocused())
                screen.SetBreadcrumbText("Menu", contentList[msg.GetIndex()].Title)
            else if (msg.isListItemSelected())
                m.menuFunctions[msg.GetIndex()]()
            endif      
        endif
    end while
End Function

Function InitTheme() as void
    app = CreateObject("roAppManager")
    
    listItemHighlight           = "#FFFFFF"
    listItemText                = "#707070"
    brandingGreen               = "#37491D"
    backgroundColor             = "#e0e0e0"
    theme = {
        BackgroundColor: backgroundColor
        OverhangSliceHD: "pkg:/images/Overhang_Slice_HD.png"
        OverhangSliceSD: "pkg:/images/Overhang_Slice_HD.png"
        OverhangLogoHD: "pkg:/images/HDLogo.png"
        OverhangLogoSD: "pkg:/images/SDLogo.png"
        OverhangOffsetSD_X: "25"
        OverhangOffsetSD_Y: "15"
        OverhangOffsetHD_X: "25"
        OverhangOffsetHD_Y: "15"
        BreadcrumbTextLeft: brandingGreen
        BreadcrumbTextRight: "#E1DFE0"
        BreadcrumbDelimiter: brandingGreen
        
        ListItemText: listItemText
        ListItemHighlightText: listItemHighlight
        ListScreenDescriptionText: listItemText
        ListItemHighlightHD: "pkg:/images/select_bkgnd.png"
        ListItemHighlightSD: "pkg:/images/select_bkgnd.png"
        CounterTextLeft: brandingGreen
        CounterSeparator: brandingGreen
        GridScreenBackgroundColor: backgroundColor
        GridScreenListNameColor: brandingGreen
        GridScreenDescriptionTitleColor: brandingGreen
        GridScreenLogoHD: "pkg://images/HDLogo.png"
        GridScreenLogoSD: "pkg://images/SDLogo.png"
        GridScreenOverhangHeightHD: "138"
        GridScreenOverhangHeightSD: "138"
        GridScreenOverhangSliceHD: "pkg:/images/Overhang_Slice_HD.png"
        GridScreenOverhangSliceSD: "pkg:/images/Overhang_Slice_HD.png"
        GridScreenLogoOffsetHD_X: "25"
        GridScreenLogoOffsetHD_Y: "15"
        GridScreenLogoOffsetSD_X: "25"
        GridScreenLogoOffsetSD_Y: "15"
    }
    app.SetTheme( theme )
End Function

Function InitContentList() as object
    contentList = [
        {
            Title: "Live",
            ID: "1",
            HDBackgroundImageUrl: "pkg:/images/breakfast_large.png",
            SDBackgroundImageUrl: "pkg:/images/breakfast_large.png",            
            ShortDescriptionLine1: "Live Feed",
            ShortDescriptionLine2: "Watch some of our live streame"
        },
        {
            Title: "Archived",
            ID: "2",
            HDBackgroundImageUrl: "pkg:/images/HDLogo.png",
            SDBackgroundImageUrl: "pkg:/images/HDLogo.png",            
            ShortDescriptionLine1: "Archived Menu",
            ShortDescriptionLine2: "Choose from our enless library of videos"            
        }    ]
    return contentList
End Function

What does the Debugger say?

It didn’t say anything other than"compilation failed"

How are you accessing the Debugger?

How I do that?

https://sdkdocs.roku.com/display/sdkdoc … pplication

Getting info from the debugger is absolutely essential, I didn’t even think to ask :shock:

I tried that but it said telnet is not recognized as a internal or external command

I assume you’re using Windows. You need to enable telnet as one of the Windows features under “Programs and Features”. However, I strongly suggest you just use belltown’s fabulous PurpleBug: viewtopic.php?f=34&t=92128&start=15#p523741

-JT

I redid the code to the menu of my Roku series.


' *********************************************************
' **  Simple Poster Screen Demonstration App
' **  Nov 2009
' **  Copyright (c) 2009 Roku Inc. All Rights Reserved.
' *********************************************************

'************************************************************
'** Application startup
'************************************************************
Function CreateShowdownMenu() as integer

    screen = CreateObject("roGridScreen")
    port = CreateObject("roMessagePort")
    screen.SetMessagePort(port)
	screen.SetBreadcrumbText("Showdown", "Full Menu")
    screen.SetupLists(1)
    screen.SetListNames(["2016"])

    screen.SetContentList(0, GetLunchMenuOptions_Healthy()) 

    screen.show()

    'prepare the screen for display and get ready to begin
    screen=preShowPosterScreen("", "")
    if screen=invalid then
        print "unexpected error in preShowPosterScreen"
        return
    end if

    'set to go, time to get started
    showPosterScreen(screen)

End Function

'******************************************************
'** Perform any startup/initialization stuff prior to 
'** initially showing the screen.  
'******************************************************
Function preShowPosterScreen(breadA=invalid, breadB=invalid) As Object

    port=CreateObject("roMessagePort")
    screen = CreateObject("roPosterScreen")
    screen.SetMessagePort(port)
    if breadA<>invalid and breadB<>invalid then
        screen.SetBreadcrumbText(breadA, breadB)
    end if

    screen.SetListStyle("arced-landscape")
    return screen

End Function

'******************************************************
'** Display the poster screen and wait for events from 
'** the screen. The screen will show retreiving while
'** we fetch and parse the feeds for the show posters
'******************************************************
Function showPosterScreen(screen As Object) As Integer

    categoryList = getCategoryList()
    screen.SetListNames(categoryList)
    screen.SetContentList(getShowsForCategoryItem(categoryList[0]))
    screen.Show()

    while true
        msg = wait(0, screen.GetMessagePort())
        if type(msg) = "roPosterScreenEvent" then
            print "showPosterScreen | msg = "; msg.GetMessage() " | index = "; msg.GetIndex()
            if msg.isListFocused() then
                'get the list of shows for the currently selected item
                screen.SetContentList(getShowsForCategoryItem(categoryList[msg.GetIndex()]))
                print "list focused | current category = "; msg.GetIndex()
            else if msg.isListItemFocused() then
                print"list item focused | current show = "; msg.GetIndex()
            else if msg.isListItemSelected() then
                print "list item selected | current show = "; msg.GetIndex() 
                'if you had a list of shows, the index of the current item 
                'is probably the right show, so you'd do something like this
                'm.curShow = displayShowDetailScreen(showList[msg.GetIndex()])
                displayBase64()
            else if msg.isScreenClosed() then
                return -1
            end if
        end If
    end while

End Function

Function displayBase64()
    ba = CreateObject("roByteArray")
    str = "Aladdin:open sesame"
    ba.FromAsciiString(str)
    result = ba.ToBase64String() 
    print result

    ba2 = CreateObject("roByteArray")
    ba2.FromBase64String(result)
    result2 = ba2.ToAsciiString()
    print result2
End Function

'*************************************************************
'** showSpringboardScreen()
'*************************************************************

Function showSpringboardScreen(item as object) As Boolean
    port = CreateObject("roMessagePort")
    screen = CreateObject("roSpringboardScreen")

    print "showSpringboardScreen"
    
    screen.SetMessagePort(port)
    screen.AllowUpdates(false)
    if item <> invalid and type(item) = "roAssociativeArray"
        screen.SetContent(item)
    endif

    screen.SetDescriptionStyle("generic") 'audio, movie, video, generic
                                        ' generic+episode=4x3,
    screen.ClearButtons()
    screen.AddButton(1,"Play")
    screen.AddButton(2,"Go Back")
    screen.SetStaticRatingEnabled(false)
    screen.AllowUpdates(true)
    screen.Show()

    downKey=3
    selectKey=6
    while true
        msg = wait(0, screen.GetMessagePort())
        if type(msg) = "roSpringboardScreenEvent"
            if msg.isScreenClosed()
                print "Screen closed"
                exit while                
            else if msg.isButtonPressed()
                    print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
                    if msg.GetIndex() = 1
                         displayVideo("")
                    else if msg.GetIndex() = 2
                         return true
                    endif
            else
                print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
            endif
        else 
            print "wrong type.... type=";msg.GetType(); " msg: "; msg.GetMessage()
        endif
    end while

    return true
End Function

'*************************************************************
'** displayVideo()
'*************************************************************

Function displayVideo(args As Dynamic)
    print "Displaying video: "
    p = CreateObject("roMessagePort")
    video = CreateObject("roVideoScreen")
    video.setMessagePort(p)

    'bitrates  = [0]          ' 0 = no dots, adaptive bitrate
    'bitrates  = [348]    ' <500 Kbps = 1 dot
    'bitrates  = [664]    ' <800 Kbps = 2 dots
    'bitrates  = [996]    ' <1.1Mbps  = 3 dots
    'bitrates  = [2048]    ' >=1.1Mbps = 4 dots
    bitrates  = [0]    

    'Swap the commented values below to play different video clips...
    ' lengthy (20+ min.) TED talk to allow time for testing multiple ad pods
    videoContent = { streamFormat : "mp4" }
    videoContent.stream = { url:  "http://video.ted.com/talks/podcast/DavidKelley_2002_480.mp4",
                            bitrate: 800,
                            quality: false
                          }
    PlayContentWithAds(videoContent)

   

    if type(args) = "roAssociativeArray"
        if type(args.url) = "roString" and args.url <> "" then
            urls[0] = args.url
        end if
        if type(args.StreamFormat) = "roString" and args.StreamFormat <> "" then
            StreamFormat = args.StreamFormat
        end if
        if type(args.title) = "roString" and args.title <> "" then
            title = args.title
        else 
            title = ""
        end if
        if type(args.srt) = "roString" and args.srt <> "" then
            srt = args.StreamFormat
        else 
            srt = ""
        end if
    end if
    
    videoclip = CreateObject("roAssociativeArray")
    videoclip.StreamBitrates = bitrates
    videoclip.StreamUrls = urls
    videoclip.StreamQualities = qualities
    videoclip.StreamFormat = StreamFormat
    videoclip.Title = title
    print "srt = ";srt
    if srt <> invalid and srt <> "" then
        videoclip.SubtitleUrl = srt
    end if
    
    video.SetContent(videoclip)
    video.show()

    lastSavedPos   = 0
    statusInterval = 10 'position must change by more than this number of seconds before saving

    while true
        msg = wait(0, video.GetMessagePort())
        if type(msg) = "roVideoScreenEvent"
            if msg.isScreenClosed() then 'ScreenClosed event
                print "Closing video screen"
                exit while
            else if msg.isPlaybackPosition() then
                nowpos = msg.GetIndex()
                if nowpos > 10000
                    
                end if
                if nowpos > 0
                    if abs(nowpos - lastSavedPos) > statusInterval
                        lastSavedPos = nowpos
                    end if
                end if
            else if msg.isRequestFailed()
                print "play failed: "; msg.GetMessage()
            else
                print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
            endif
        end if
    end while
End Function

'**************************************************************
'** Return the list of categories to display in the filter
'** banner. The result is an roArray containing the names of 
'** all of the categories. All just static data for the example.
'***************************************************************
Function getCategoryList() As Object

    categoryList = CreateObject("roArray", 10, true)

    categoryList = [ "2016"  ]
    return categoryList

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 getShowsForCategoryItem(category As Object) As Object

    print "getting shows for category "; category

    showList = [

        {
            ShortDescriptionLine1:"Show #2",
            ShortDescriptionLine2:"Short Description for Show #2",
            HDPosterUrl:"pkg:/media/bogusFileName_hd.jpg",
            SDPosterUrl:"pkg:/media/bogusFileName_hd.jpg"
        }
    ]

    return showList

End Function

I ran it and the command prompt said return needs to return a value

Return has to return whatever type of value you have declared the Function to be, unless you declare it to be VOID

How do I declare it to be VOID?

Example:

FUNCTION initBook(bk, y, x, rm) AS VOID

I fixed the problem and got the menu working


' *********************************************************
' **  Simple Poster Screen Demonstration App
' **  Nov 2009
' **  Copyright (c) 2009 Roku Inc. All Rights Reserved.
' *********************************************************

'************************************************************
'** Application startup
'************************************************************
Function CreateShowdownMenu() as integer

    screen = CreateObject("roGridScreen")
    port = CreateObject("roMessagePort")
    screen.SetMessagePort(port)
	screen.SetBreadcrumbText("Showdown", "Full Menu")
    screen.SetupLists(1)
    screen.SetListNames(["2016"])

    screen.SetContentList(0, GetShowdownMenuOptions_2016()) 

    screen.show()

    while (true)
        msg = wait(0, port)
        if type(msg) = "roGridScreenEvent"
            else if (msg.isListItemSelected())
                showSpringboardScreen(itemVenter)  
   'showSpringboardScreen(itemMpeg4)  'uncomment this line and comment out the next to see the old mpeg4 example
   'showSpringboardScreen(item)       'uncomment this line to see the BigBuckBunny example

            endif
        
    end while

End Function

'*************************************************************
'** showSpringboardScreen()
'*************************************************************

Function showSpringboardScreen(item as object) As Boolean
    port = CreateObject("roMessagePort")
    screen = CreateObject("roSpringboardScreen")

    print "showSpringboardScreen"
    
    screen.SetMessagePort(port)
    screen.AllowUpdates(false)
    if item <> invalid and type(item) = "roAssociativeArray"
        screen.SetContent(item)
    endif

    screen.SetDescriptionStyle("generic") 'audio, movie, video, generic
                                        ' generic+episode=4x3,
    screen.ClearButtons()
    screen.AddButton(1,"Play")
    screen.AddButton(2,"Go Back")
    screen.SetStaticRatingEnabled(false)
    screen.AllowUpdates(true)
    screen.Show()

    downKey=3
    selectKey=6
    while true
        msg = wait(0, screen.GetMessagePort())
        if type(msg) = "roSpringboardScreenEvent"
            if msg.isScreenClosed()
                print "Screen closed"
                exit while                
            else if msg.isButtonPressed()
                    print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
                    if msg.GetIndex() = 1
                         displayVideo("")
                    else if msg.GetIndex() = 2
                         return true
                    endif
            else
                print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
            endif
        else 
            print "wrong type.... type=";msg.GetType(); " msg: "; msg.GetMessage()
        endif
    end while

    return true
End Function

'*************************************************************
'** displayVideo()
'*************************************************************

Function displayVideo(args As Dynamic)
    print "Displaying video: "
    p = CreateObject("roMessagePort")
    video = CreateObject("roVideoScreen")
    video.setMessagePort(p)

    'bitrates  = [0]          ' 0 = no dots, adaptive bitrate
    'bitrates  = [348]    ' <500 Kbps = 1 dot
    'bitrates  = [664]    ' <800 Kbps = 2 dots
    'bitrates  = [996]    ' <1.1Mbps  = 3 dots
    'bitrates  = [2048]    ' >=1.1Mbps = 4 dots
    bitrates  = [0]    

    'Swap the commented values below to play different video clips...
    ' lengthy (20+ min.) TED talk to allow time for testing multiple ad pods
    videoContent = { streamFormat : "mp4" }
    videoContent.stream = { url:  "http://video.ted.com/talks/podcast/DavidKelley_2002_480.mp4",
                            bitrate: 800,
                            quality: false
                          }
    PlayContentWithAds(videoContent)

   

    if type(args) = "roAssociativeArray"
        if type(args.url) = "roString" and args.url <> "" then
            urls[0] = args.url
        end if
        if type(args.StreamFormat) = "roString" and args.StreamFormat <> "" then
            StreamFormat = args.StreamFormat
        end if
        if type(args.title) = "roString" and args.title <> "" then
            title = args.title
        else 
            title = ""
        end if
        if type(args.srt) = "roString" and args.srt <> "" then
            srt = args.StreamFormat
        else 
            srt = ""
        end if
    end if
    
    videoclip = CreateObject("roAssociativeArray")
    videoclip.StreamBitrates = bitrates
    videoclip.StreamUrls = urls
    videoclip.StreamQualities = qualities
    videoclip.StreamFormat = StreamFormat
    videoclip.Title = title
    print "srt = ";srt
    if srt <> invalid and srt <> "" then
        videoclip.SubtitleUrl = srt
    end if
    
    video.SetContent(videoclip)
    video.show()

    lastSavedPos   = 0
    statusInterval = 10 'position must change by more than this number of seconds before saving

    while true
        msg = wait(0, video.GetMessagePort())
        if type(msg) = "roVideoScreenEvent"
            if msg.isScreenClosed() then 'ScreenClosed event
                print "Closing video screen"
                exit while
            else if msg.isPlaybackPosition() then
                nowpos = msg.GetIndex()
                if nowpos > 10000
                    
                end if
                if nowpos > 0
                    if abs(nowpos - lastSavedPos) > statusInterval
                        lastSavedPos = nowpos
                    end if
                end if
            else if msg.isRequestFailed()
                print "play failed: "; msg.GetMessage()
            else
                print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
            endif
        end if
    end while
End Function

Function PlayVideoContent(content as Object) as Object
    ' roVideoScreen just closes if you try to resume or seek after ad playback,
    ' so just create a new instance of the screen...
    videoScreen = CreateObject("roVideoScreen")
    videoScreen.SetContent(content)
    ' need a reasonable notification period set if midroll/postroll ads are to be
    ' rendered at an appropriate time
    videoScreen.SetPositionNotificationPeriod(1)
    videoScreen.SetMessagePort(CreateObject("roMessagePort"))
    videoScreen.Show()

    return videoScreen
End Function

Sub PlayContentWithAds(videoContent as Object)
    canvas = CreateObject("roImageCanvas")
    canvas.SetLayer(1, {color: "#000000"})
    canvas.SetLayer(2, {text: "Loading..."})
    canvas.Show()

    adIface = Roku_Ads()
    print "Roku_Ads library version: " + adIface.getLibVersion()
    ' Normally, would set publisher's ad URL here.  Otherwise uses default Roku ad server (with single preroll placeholder ad)
    'adIface.setAdUrl() 

    adPods = adIface.getAds()
    playContent = adIface.showAds(adPods) ' show preroll ad pod (if any)

    curPos = 0
    if playContent
        videoScreen = PlayVideoContent(videoContent)
    end if

    closingContentScreen = false
    contentDone = false
    while playContent 
        videoMsg = wait(0, videoScreen.GetMessagePort())
        if type(videoMsg) = "roVideoScreenEvent"
            if videoMsg.isStreamStarted()
                canvas.ClearLayer(2)
            end if
            if videoMsg.isPlaybackPosition()
                ' cache current playback position for resume after midroll ads
                curPos = videoMsg.GetIndex()
            end if

            if not closingContentScreen ' don't check for any more ads while waiting for screen close
                if videoMsg.isScreenClosed() ' roVideoScreen sends this message last for all exit conditions
                    playContent = false
               else if videoMsg.isFullResult()
                    contentDone = true ' don't want to resume playback after postroll ads
               end if

               ' check for midroll/postroll ad pods
               adPods = adIface.getAds(videoMsg)
               if adPods <> invalid and adPods.Count() > 0
                   ' must completely close content screen before showing ads
                   ' for some Roku platforms (e.g., RokuTV), calling Close() will not synchronously
                   ' close the media player and may prevent a new media player from being created
                   ' until the screen is fully closed (app has received the isScreenClosed() event)
                   videoScreen.Close()
                   closingContentScreen = true
               end if
            else if videoMsg.isScreenClosed()
                closingContentScreen = false ' now safe to render ads
            end if ' closingContentScreen

            if not closingContentScreen and adPods <> invalid and adPods.Count() > 0
                ' now safe to render midroll/postroll ads
                playContent = adIface.showAds(adPods)
                playContent = playContent and not contentDone
                if playContent
                    ' resume video playback after midroll ads
                    videoContent.PlayStart = curPos
                    videoScreen = PlayVideoContent(videoContent)
                end if
            end if ' !closingContentScreen
        end if ' roVideoScreenEvent
    end while
    if type(videoScreen) = "roVideoScreen" then videoScreen.Close()
End Sub

'********************************************************************
'** 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 GetShowdownMenuOptions_2016() as object
        options = [

        {
            ShortDescriptionLine1:"Show #2",
            ShortDescriptionLine2:"Short Description for Show #2",
            HDPosterUrl:"pkg:/media/bogusFileName_hd.jpg",
            SDPosterUrl:"pkg:/media/bogusFileName_hd.jpg"
        }
    ]

return options
End Function

But I cant get the menu to show the springboard screen


while (true)
        msg = wait(0, port)
        if type(msg) = "roGridScreenEvent"
            else if (msg.isListItemSelected())
                showSpringboardScreen(itemVenter)  
   'showSpringboardScreen(itemMpeg4)  'uncomment this line and comment out the next to see the old mpeg4 example
   'showSpringboardScreen(item)       'uncomment this line to see the BigBuckBunny example

            endif
        
    end while

I don’t think you want that “else” in the isListItemSelected test.

–Mark

I have been working on this code to connect to my site

Sub RunUserInterface()
    screen = CreateObject("roSGScreen")
    scene = screen.CreateScene("HomeScene")
    port = CreateObject("roMessagePort")
    screen.SetMessagePort(port)
    screen.Show()
    
    oneRow = GetApiArray()
    list = [
        {
            ContentList : oneRow
        }
    ]
    scene.gridContent = ParseXMLContent(list)
    while true
        msg = wait(0, port)
        print "------------------"
        print "msg = "; msg
    end while
    
    if screen <> invalid then
        screen.Close()
        screen = invalid
    end if
End Sub

Function ParseXMLContent(list As Object)
    RowItems = createObject("RoSGNode","ContentNode")
    
    for each rowAA in list
    'for index = 0 to 1
        row = createObject("RoSGNode","ContentNode")
        row.Title = rowAA.Title
        for each itemAA in rowAA.ContentList
            item = createObject("RoSGNode","ContentNode")
            ' We don't use item.setFields(itemAA) as doesn't cast streamFormat to proper value
            for each key in itemAA
                item[key] = itemAA[key]
            end for
            row.appendChild(item)
        end for
        RowItems.appendChild(row)
    end for
    return RowItems
End Function

Function GetApiArray()
    url = CreateObject("roUrlTransfer")
    url.SetUrl("http://griffingatv.website/xml/categories.xml")
    rsp = url.GetToString()
    responseXML = ParseXML(rsp)
    responseXML = responseXML.GetChildElements()
    responseArray = responseXML.GetChildElements()
    result = []
    for each xmlItem in responseArray
        if xmlItem.getName() = "item"
            itemAA = xmlItem.GetChildElements()
            if itemAA <> invalid
                item = {}
                for each xmlItem in itemAA
                    item[xmlItem.getName()] = xmlItem.getText()
                    if xmlItem.getName() = "media:content"
                        item.stream = {url : xmlItem.url}
                        item.url = xmlItem.getAttributes().url
                        item.streamFormat = "mp4"
                        
                        mediaContent = xmlItem.GetChildElements()
                        for each mediaContentItem in mediaContent
                            if mediaContentItem.getName() = "media:thumbnail"
                                item.HDPosterUrl = mediaContentItem.getattributes().url
                                item.hdBackgroundImageUrl = mediaContentItem.getattributes().url
                            end if
                        end for
                    end if
                end for
                result.push(item)
            end if
        end if
    end for
    return result
End Function

Function ParseXML(str As String) As dynamic
    if str = invalid return invalid
    xml=CreateObject("roXMLElement")
    if not xml.Parse(str) return invalid
    return xml
End Function

There’s an error, How can I fix this?
‘Dot’ Operator attempted with invalid BrightScript Component or interface reference. (runtime error &
hec) in pkg:/source/main.brs(60)
060:     responseXML = responseXML.GetChildElements()