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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Acudeo Ads attachment Problem

Here is my appHomescreen.brs code.On the top side another function name showHomescreen() so it 's my point there
i add playAd() Acudeo ads function show at the appvideoscreen.brs but there i have problem with to handle loop my mean when i play channel my add started and then my channel start after commercial but when i press back bottom so again popup commercial. Please help

Best regrades

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

if validateParam(breadA, "roString", "preShowHomeScreen", true) = false return -1
if validateParam(breadA, "roString", "preShowHomeScreen", true) = false return -1

screen = CreateObject("roPosterScreen")
'if breadA<>invalid and breadB<>invalid then
' screen.SetBreadcrumbText(breadA, breadB)
' end if
return screen

End Function

'** Display the home screen and wait for events from
'** the screen. The screen will show retreiving while
'** we fetch and parse the feeds for the game posters
Function showHomeScreen(screen as object ) As Integer

if validateParam(screen, "roPosterScreen", "showHomeScreen") = false return -1

m.curCategory = 0

while true
msg = wait(0, screen.GetMessagePort())

if type(msg) = "roPosterScreenEvent" then
print "showHomeScreen | msg = "; msg.GetMessage() " | index = "; msg.GetIndex()
if msg.isListFocused() then
m.curCategory = msg.GetIndex()
m.curShow = 0
screen.SetContentList(getShowsForCategoryItem(m.Categories, m.curCategory))
print "list focused | current category = "; m.curCategory
else if msg.isListItemSelected() then


m.curShow = msg.GetIndex()
print "list item selected | current show = "; m.curShow
'm.curShow = displayShowDetailScreen(category, m.curShow)

showList = getShowsForCategoryItem(m.Categories, m.curShow)
'print "showList: ";showList[0]
print "list item updated | new show = "; m.curShow
[color=#FF0000] showVideoScreen(showList[0])[/color]
' print "m.Categories feed: ";[m.curShow].kids[0].feed

'if kid.type = "special_category" then

end if

else if msg.isScreenClosed() then
return 0
end if
'end If
end while

return 0

End Function

'** When a poster on the home screen is selected, we call
'** this function passing an associative array with the
'** data for the selected show. This data should be
'** sufficient for the show detail (springboard) to display
'Function displayCategoryPosterScreen(category As Object) As Dynamic

'if validateParam(category, "roAssociativeArray", "displayCategoryPosterScreen") = false return -1
'screen = preShowDetailScreen(category.Title, "")
'showDetailScreen(screen, showList, showIndex)
'return 0
'End Function
Function displayShowDetailScreen(category as Object, showIndex as Integer) As Integer

if validateParam(category, "roAssociativeArray", "displayShowDetailScreen") = false return -1

shows = getShowsForCategoryItem(category, m.curCategory)
screen = preShowDetailScreen(category.Title,[m.curCategory].Title)
showIndex = showDetailScreen(screen, shows, showIndex)

return showIndex
End Function
'** Special categories can be used to have categories that
'** don't correspond to the content hierarchy, but are
'** managed from the server by data from the feed. In these
'** cases we might show a different type of screen other
'** than a poster screen of content. For example, a special
'** category could be search, music, options or similar.
Function displaySpecialCategoryScreen() As Dynamic

' do nothing, this is intended to just show how
' you might add a special category ionto the feed

return 0
End Function

'** initialize the category tree. We fetch a category list
'** from the server, parse it into a hierarchy of nodes and
'** then use this to build the home screen and pass to child
'** screen in the heirarchy. Each node terminates at a list
'** of content for the sub-category describing individual videos
Function initCategoryList() As Void

conn = InitCategoryFeedConnection()

m.Categories = conn.LoadCategoryFeed(conn)
m.CategoryNames = conn.GetCategoryNames(m.Categories)

End Function
Function getShowsForCategoryItem(category As Object, item As Integer) As Object

if validateParam(category, "roAssociativeArray", "getCategoryList") = false return invalid

conn = InitShowFeedConnection([item])
'print "Connection: ";conn
showList = conn.LoadShowFeed(conn)
return showList

End Function

'Function getShowsForCategoryItem(category As Object, item As Integer) As Object

'if validateParam(category, "roAssociativeArray", "getCategoryList") = false return invalid

'conn = InitShowFeedConnection([item])
'showList = conn.LoadShowFeed(conn)
'return showList

'End Function
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.