WP7 and Music Hub

Daniel Ratcliffe

New member
Dec 5, 2011
3,061
0
0
Visit site
Ok, so I'm wanting to release my WP7 app, but one of the things that has me irked is I can't seem to find a way to get audio from the app into the default music player. What I'll be doing is adding a playlist that consists of copies of the stream plus a "Bridge" which plays in between shows on the station to prevent dead air. Now, is there any way to plug this in to the music player while bypassing the shuffle? The reason for bypassing shuffle even if the user has it set is because I don't want 2 stream files next to each other, they need to be bridged. The files are all online so would be streamed to the device (warning about data usage will also be given).
 

Catholic Tech Geek

New member
Feb 2, 2012
130
0
0
Visit site
You can't edit system playlists in Zune or directly modify the MediaPlayer's MediaQueue. What you can do in your app is to query the MediaLibrary for the music you want, and then use MediaPlayer.play() to play the Song you wanted. If you have streaming media, you can use Song.FromUri() to get a Song object for MediaPlayer.play(). If you want any kind of "playlist", you will have to manage that yourself somehow. To insert the "bridge", you can hook into the MediaPlayer's MediaStateChanged event to control the flow of the audio you want to play. For dealing with shuffle, you can save whatever value shuffle is set to when you start the app, set MediaPlayer.IsShuffled() to false, and then restore the original value of shuffle when the program exits.
 
Last edited:

Daniel Ratcliffe

New member
Dec 5, 2011
3,061
0
0
Visit site
Had a look through the links. They all seem to be XNA based commands. How would that differ with a standard Silverlight app, if at all?

For dealing with shuffle, you can save whatever value shuffle is set to when you start the app, set MediaPlayer.IsShuffled() to false, and then restore the original value of shuffle when the program exits.

Thanks, would that involve a "get" command to grab the current state, and then setting that value back upon exiting the app? Also, where would that state be stored ready for calling on the app's departure? Final thing is that I'm integrating it into background audio so it plays even when the app isn't open, similar to TuneIn Radio, so not sure if that property would be useful.

However, if I can find a way to store the state upon closing the app, so that it can be reset upon stopping the app's playlist (along with the Now Playing playlist prior to starting the app's playlist) that would be fantastic. I'm only having Play and Stop buttons in my app, to grab the stream and clear the stream playlists. Controls such as pausing the stream, and skipping tracks, will be handled by the UVC.
 

Members online

No members online now.

Forum statistics

Threads
323,197
Messages
2,243,435
Members
428,036
Latest member
jallymonz