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: 

play audio while navigation screen

I want to allow during the song plays to navigate between screens. How to do it?
Where to define the audioPlayer in order to in screen closing the song will not be finished.

thanks
0 Kudos
1 REPLY 1
RokuJoel
Binge Watcher

Re: play audio while navigation screen

create the audioplayer as a global variable:

m.audioplayer=createobject("roaudioplayer")

you probably want to do this near the beginning of your program.

You should also probably include checks for roAudioPlayerEvents in all your event loops, and track playlist position and song elapsed time in global variables as well. I don't recommend using a global port if you are new to Brightscript, so you would probably want to assign the global audio player to the port variable you are working with in each function.

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