Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Level 7

Adding sdposterurl into array

I'm looping through video ep's (really only need one) and i'm trying to display an image for the entry. I've got everything to work but this. the documentation doesn't show how to do this in an array. Here is my code, you'll see o.SDPosterUrl:"file://pkg:/images/livestream.png" causes an error and so does SDPosterUrl:"file://pkg:/images/livestream.png". The documentation says i should be able to just place SDPosterURL. Perhaps i'm doing this wrong?

Thanks,


Function showHomeScreen(screen) As Integer

if type(screen)<>"roPosterScreen" then
print "illegal type/value for screen passed to showHomeScreen"
return -1
end if

' itemNames = getItemNames()
'screen.SetContentList(itemNames)

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

o = CreateObject("roAssociativeArray")
o.ContentType = "episode"

o.Title = ""
o.ShortDescriptionLine1 = ""
o.ShortDescriptionLine2 = ""
o.SDPosterUrl:"file://pkg:/images/l.png"

list.Push(o)

screen.SetContentList(list)
screen.Show()


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

if type(msg) = "roPosterScreenEvent" then
print "showHomeScreen | msg = " + msg.GetMessage() + " | index = " + itostr(msg.GetIndex())

if msg.isListItemSelected() then
live()

else if msg.isScreenClosed() then
return -1
end if
end If
end while

End Function
0 Kudos
4 Replies
Highlighted
Roku Employee
Roku Employee

Re: Adding sdposterurl into array

Have you tried it without file:// ?

o.SDPosterUrl:"pkg:/images/l.png"
0 Kudos
Highlighted
Level 7

Re: Adding sdposterurl into array

Still error's out as a syntax error.
0 Kudos
Highlighted
Level 7

Re: Adding sdposterurl into array

It is a syntax error. You are using associative array assignment syntax outside an associative array.

o.SDPosterUrl:"file://pkg:/images/l.png"

Should be

o.SDPosterUrl = "file://pkg:/images/l.png"


Looks like you switched between assigning the whole array at once and assigning values individually and missed that one.
-- GandK Labs
Check out Reversi! in the channel store!
0 Kudos
Highlighted
Level 7

Re: Adding sdposterurl into array

"kbenson" wrote:
It is a syntax error. You are using associative array assignment syntax outside an associative array.

o.SDPosterUrl:"file://pkg:/images/l.png"

Should be

o.SDPosterUrl = "file://pkg:/images/l.png"


Looks like you switched between assigning the whole array at once and assigning values individually and missed that one.


This helped me out! Thanks
My channels: Amiri King, Donnie Baker, Worldview Weekend - Twitter @rjdjohnston
0 Kudos