Hi, I am trying to figure out how to make mp3 music start when I click my channel and have it stop when I select a Category and video when I hit Play. I use the videoplayer from the sdk
I need to be able to do this using an external xml file as I do for my video content now to change at will my mp3 selection at the start of the Channel.
It's working now
I have a function call appSound(screen) in appMain.brs and a stopSound in videoplayer.brs that works now. I just need a way to get an xml file read in to play the mp3 versus placing the http path to the mp3 in the appSound.brs.
Here is my appSound.brs content. I am still new at programming so be easy on me and if you have a complete solution let me know or PM me.
Function startSound(screen)
m.audio = CreateObject("roAudioPlayer")
item = CreateObject("roAssociativeArray")
item.Url = "http://www.xxxxx.org/roku/music/Letsride.mp3"
item.StreamFormat = "mp3"
m.audio.AddContent(item)
item.Url = "http://www.xxxxx.com/RokuDir/audio/town.mp3"
item.StreamFormat = "mp3"
m.audio.AddContent(item)
m.audio.SetLoop(true)
m.audio.Play()
' you can add more audio as this has 2 mp3's in line to play or add more.
End Function
Function stopSound()
m.audio.Stop()
End Function