stitch1z
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2011
07:33 PM
Add trailer link button
I hope I'm not being annoying with my posts. I'm really catching on to the how Roku works, but I'm still new to it.
Anyone know how to add a how to link a button on the springboard to a trailer (not the built-in 2 min preview, a totally different video)?
Thank you in advance!
Anyone know how to add a how to link a button on the springboard to a trailer (not the built-in 2 min preview, a totally different video)?
Thank you in advance!
9 REPLIES 9
stitch1z
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2011
08:43 PM
Re: Add trailer link button
Curious if I am on the right track...
if msg.GetIndex() = 7
item.StreamUrls.Push(validstr(e.preview.GetText()))
endif
stitch1z
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2011
08:57 AM
Re: Add trailer link button
Still struggling with this.
I am using the videoplayer example as a source.
I have defined the <trailer> in my xml, but I have no idea how to parse this and play it when someone hits button "7". Do I put all of the code in appDetailScreen.brs or do I parse it in Showfeed.brs and somehow refer to it in appDetailScreen?
Do I use the showVideoScreen or not? Ugh. This is kicking my butt. lol
I am using the videoplayer example as a source.
I have defined the <trailer> in my xml, but I have no idea how to parse this and play it when someone hits button "7". Do I put all of the code in appDetailScreen.brs or do I parse it in Showfeed.brs and somehow refer to it in appDetailScreen?
Do I use the showVideoScreen or not? Ugh. This is kicking my butt. lol
stitch1z
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2011
10:57 AM
Re: Add trailer link button
I realize that I am talking to myself for the mostpart, but just in case any of you frighteningly intelligent folks wish to chime in, I'm trying this now, which I would think should be on the right track... ?
Obviously, I wouldn't use the actual url in the brightscript like that, but at this point I am trying to isolate where I am going wrong. Once I get the function to work with a hardcoded url in the brightscript, I will tackle parsing it from an xml file.
What's funny is that I am having this much difficulty simply trying to communicate to the Roku:
"IF I press button '7', play this file." And I am too dopey to work that out. Sheesh!
if msg.GetIndex() = 7
Function showVideoScreen(movie As Object)
screen = CreateObject("roVideoScreen")
movie.Stream = { url:"http://video.ted.com/talks/podcast/ElizabethGilbert_2009_480.mp4",
contentid:"mycontent-2000"
}
screen.SetContent(movie)
screen.SetMessagePort(port)
screen.Show()
End Function
endif
Obviously, I wouldn't use the actual url in the brightscript like that, but at this point I am trying to isolate where I am going wrong. Once I get the function to work with a hardcoded url in the brightscript, I will tackle parsing it from an xml file.
What's funny is that I am having this much difficulty simply trying to communicate to the Roku:
"IF I press button '7', play this file." And I am too dopey to work that out. Sheesh!


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2011
11:20 AM
Re: Add trailer link button
You don't need to redefine the function within the event loop. That will probably give you an error on install along the lines of "function defined multiple times". You can reuse the existing one. And changing the stream URL of the existing content-meta-data is an option, but it might make more sense to build a separate content-meta-data for the trailer.
if msg.GetIndex() = 7
trailer = {
stream: { url:"http://video.ted.com/talks/podcast/ElizabethGilbert_2009_480.mp4" }
streamFormat: "mp4"
}
ShowVideoScreen(trailer)
end if
stitch1z
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2011
12:28 PM
Re: Add trailer link button
"RokuChris" wrote:
You don't need to redefine the function within the event loop. That will probably give you an error on install along the lines of "function defined multiple times". You can reuse the existing one. And changing the stream URL of the existing content-meta-data is an option, but it might make more sense to build a separate content-meta-data for the trailer.
Thank you SOOOO much, Chris! That works!
Do to parse this from xml, it would look something like this?
if msg.GetIndex() = 7
trailer = {
stream: { item.trailer.GetText() }
streamFormat: "mp4"
}
ShowVideoScreen(trailer)
endif
I know this doesn't function properly because I tested it, but I again, just trying to figure out if I am on the right track.
The XML structure is:
<feed>
<item>
<trailer>
Thank you again! So appreciated!
stitch1z
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2011
07:53 PM
Re: Add trailer link button
Still struggling through this. I just can't figure out the language to make it happen...
Any input is highly appreciated! 😄
Any input is highly appreciated! 😄
stitch1z
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2011
09:42 AM
Re: Add trailer link button
So would I even call "stream"?
Or would I define this in the showfeed.brs?
And if so, would it be like:
I'm just so confused about this...
Or would I define this in the showfeed.brs?
And if so, would it be like:
item.StreamUrls = item.trailer
I'm just so confused about this...


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2011
10:09 AM
Re: Add trailer link button
"stitch1z" wrote:if msg.GetIndex() = 7
trailer = {
stream: { item.trailer.GetText() }
streamFormat: "mp4"
}
ShowVideoScreen(trailer)
endif
Your XML structure is out of scope here, so the variable item doesn't exist at this point in the code. You need to extract those values at the same time you're extracting all the other data from your XML. The easiest thing to do is to just build the trailer's content-meta-data in the parsing routine and store it as an attribute of the main content-meta-data. So you would add something like this to your parsing logic...
item.trailer = {
stream: { url: validstr(curShow.trailer.GetText()) }
streamFormat: "mp4"
}
Then you can eliminate that logic from the springboard code and just play the trailer you already built...
if msg.GetIndex() = 7
ShowVideoScreen(showList[showIndex].trailer)
end if
stitch1z
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2011
11:07 AM
Re: Add trailer link button
WORKED!
You are amazing! I really appreciate the patience.
I have some coding experience, but I learn a lot better through step-by-step tutorials. The SDK documentation is abundant, but just reading "x works with y which could also be combined with z to create b" is really tough for a dummy like me to wrap my head around.
Again, I really appreciate the help and your patience. I hope this thread will help another noob someday.
You are amazing! I really appreciate the patience.
I have some coding experience, but I learn a lot better through step-by-step tutorials. The SDK documentation is abundant, but just reading "x works with y which could also be combined with z to create b" is really tough for a dummy like me to wrap my head around.
Again, I really appreciate the help and your patience. I hope this thread will help another noob someday.