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

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 4
RokuChris
Roku Employee
Roku Employee

Re: Adding sdposterurl into array

Have you tried it without file:// ?

o.SDPosterUrl:"pkg:/images/l.png"
0 Kudos
pinehead
Visitor

Re: Adding sdposterurl into array

Still error's out as a syntax error.
0 Kudos
kbenson
Visitor

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
rjdjohnston
Binge Watcher

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
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.