Get ready for beta!

Prepare for Halo Wars 2 Blitz Mode beta: Everything you need to know!

One Windows

Microsoft is building a new Windows 10 Shell for PC, Mobile and Xbox

On the Inside

Everything you need to know about the Xbox Insider Program

Beautiful compromises

Surface Studio review: you'll want one, even if you don't need one

3-in-1

Is this the Surface Phone? Microsoft awarded patents for foldable devices

Windows Central Offers

MCSE Certification bundle is just $39

Even more improvements

All the changes found in Windows 10 build 15007!

Games as a Service

What does the cancellation of Scalebound mean for future Xbox exclusives?

Windows Central Offers

Save $90 on these FRESHeBUDS Pro Magnetic Bluetooth Earbuds

Returning for 2017

We're back with an new episode of #AskDanWindows

Lifetime Subscription

VPNSecure is currently 91% off

Our favorite things

The Best of CES 2017 Awards

Infinity Edge in your hand

The XPS 13 2-in-1 is the Dell convertible we've always wanted

Project Valerie

Razer just made a laptop with three — THREE! — 17-inch 4K displays. 😱

Great design from Palo Alto

HP's CES 2017 releases are truly gorgeous PCs

Intel and Google's big day

CES 2017 Day Two: New laptops, new phones, and old ideas made new

Take five is better than ever

The updated Lenovo ThinkPad X1 packs Kaby Lake chips and zero bloatware

Everything we know about the next Xbox: Project Scorpio

UWPowered

'Game Mode' for Windows 10 will power Xbox One and Scorpio games too

Buyer's guide

Best accessories for Microsoft Surface Book

< >
Welcome to the Windows Central Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
Results 1 to 3 of 3
  1. Daniel Ratcliffe's Avatar
    Retired Moderator

    Posts
    3,046 Posts
    Global Posts
    4,703 Global Posts
       #1  
    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).
  2. #2  
    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 by Catholic Tech Geek; 01-16-2013 at 01:33 PM.
  3. Daniel Ratcliffe's Avatar
    Retired Moderator

    Posts
    3,046 Posts
    Global Posts
    4,703 Global Posts
       #3  
    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?

    Quote Originally Posted by Catholic Tech Geek View Post
    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.

Similar Threads

  1. Replies: 5
    Last Post: 08-02-2011, 03:05 AM
  2. FastBall 2 now arrived to WP7 and is FREE!
    By Ozden79 in forum App Spotlight
    Replies: 0
    Last Post: 08-01-2011, 05:50 PM
  3. WP7 and Ford Sync?
    By daniel_leavitt2000 in forum Windows Phone 7
    Replies: 24
    Last Post: 07-26-2011, 04:54 PM
  4. Replies: 6
    Last Post: 05-31-2011, 11:47 AM
  5. Replies: 8
    Last Post: 03-10-2011, 12:42 PM

Posting Permissions