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: 
theclosh
Visitor

Multiple channel types in one channel

Hello. I created a channel by manipulating the monitorsetup example to give me a fairly nice beginner channel with a couple slideshow presentations. However, now I am attempting to use the AudioApp example to integrate another Category into my current channel to provide a sublist of audio I have on the internet. I know I will be able to figure out inputting the needed code to get my audio but I'm having troubles getting the two formats to work together. I have a poster display for the category but if I click on it I get nothing or it returns to the main menu.

Any help available? Is this possible?


Thanks,

Chris
0 Kudos
2 REPLIES 2
jbrave
Channel Surfer

Re: Multiple channel types in one channel

Sure, this is pretty easy to do.

lets say you have a set of poster items:

posterlist=[{shortdescriptionline1:"slideshow",action:"slideshow"},{shortdescriptionline1:"slideshow2",action="slideshow"},{shortdescriptionline1:"audio item",action:"music",song:{url:"http://www.musicwebsite.com/my.mp3",streamformat:"mp3"}}]


if the audio item is selected, then:

so:
 
while true
msg=wait(0,port)
if type(msg)="roPosterScreenEvent" then
ndx=msg.getindex()
if posterlist[ndx].action="music" then
audioplayer.stop()
audioplayer.clearcontent()
audioplayer.addcontent(posterlist[ndx].song)
audioplayer.play()
else
...do slide show
end if


Of course this is a very rough example, but hopefully you get the idea. You essentially create an audio player, then hand it an roAssociativeArray, in this example called song. You could do it like this:

audioplayer.addcontent({url:"http://my.com/m.mp3",streamformat:"mp3"})
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
theclosh
Visitor

Re: Multiple channel types in one channel

Awesome! I was afraid it wasn't possible. It appears I was digging too far down into the code to make it happen.

Thanks a lot!

Chris
0 Kudos