beowulf573
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2011
08:03 PM
roAudioPlayer and current item
Is there a way to detect the current item from the content list currently being played by a roAudioPlayer?
I'd like to set a list of items, start playing, navigate other screens, and ultimately come back to a "Now Playing" screen. But since I'll be moving about I may not get the list item change message from the audio player in order to update the current item.
Thanks.
I'd like to set a list of items, start playing, navigate other screens, and ultimately come back to a "Now Playing" screen. But since I'll be moving about I may not get the list item change message from the audio player in order to update the current item.
Thanks.
5 REPLIES 5
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2011
09:17 PM
Re: roAudioPlayer and current item
I don't think so. If you use one message port for all your screens you can check for roAudioPlayerEvents in all your message loops and keep track of when a new list item is selected that way.
-JT
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
jbrave
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2011
11:07 PM
Re: roAudioPlayer and current item
Another approach which I use is to create a global roaudioplayer, which you can use with any port, and store now-playing info in global variables, and a single audio event handler which you can call from any function on an audioplayer event, so you can track the current state from anywhere.
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
beowulf573
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2011
04:52 AM
Re: roAudioPlayer and current item
Is there a downside to using the same port object on all screens? I already have a global player and associated port, so I could use reuse that port for the poster screens, etc, and route audio events to common code.
Thanks.
Thanks.
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2011
04:28 PM
Re: roAudioPlayer and current item
I think the downside would be if you opened two of the same type of screen, one on top of the other, you'd have to be sure you knew which screen the events were meant for. I don't think that's much, if any, of a downside and in fact the documentation for roSystemLog recommends using one roMessagePort throughout your application if you want to use that component.
-JT
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
beowulf573
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2011
08:37 PM
Re: roAudioPlayer and current item
Great, thanks. I just refactored my code to use a single message port, but haven't had time to really test it. I'll keep an eye out for odd messages. I check in each screen event loop for an audio event and handle it, and also use a time span to update the current play time.