How can we improve the Windows dev platform?

MediaPlayer support for BackgroundAudioAgent

In trying to develop a custom playlist application, it is apparent that it is impossible to integrate the BackgroudAudioPlayer with the XNA.MediaLibrary. This means that applications that wish to use the capabilities of the BackgroundAgent are restricted to using only local audio files that are deployed with teh application, or audio streaming sources. There is no way to access the phone's MediaLibray.Songs to have the BAP play these files in teh background. This is highly restrictive because we can only use the MediaPlayer for foreground applications. Unless of course we go with a predetermined SongCollection such as SongCollection limitedPlaylist = new MediaLibrary.Songs; This stops the ability to create custom playlists.

There are really a number of ways MS could address this limitation:
1. Expose the SongCollection class so we can add and remove song objects from custome song collections. This way we can pass the entire SongCollection object to the MediaPlayer.Play() method, and providing we don't stop the MediaPlayer, the entire playlist will continue to play despite other foreground applications running.

2. Allow the BackgorundAudioAgent to utilise the XNA framework so that the device's song library can be played and manipulated from the background. You would also need to provide a conversion mechanism to convert a Song to an AudioTrack - as is the default file type for the BAP.

3. Relax the restrictions around application running under a locked screen and/or in the background. So long as the user must explicitally accept the use of teh app in the background, then why is it an issue. Users understand the additional strain this would potentially put on battery life, but by accepting they agree that it's okay.

These are only my suggestions, there may be smarter ways to achieve this, but in the end, the current functionallity is pointless.

65 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Aaron SimonsAaron Simons shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    Sorry, no plans!  ·  Clint RutkasAdminClint Rutkas (Admin, Windows Developer) responded  · 

    Please look at how we do background audio now in UWP. Below on MSDN and Building Apps for Windows, are two very nice overviews and walk through on implementing background audio with a media player. I’m closing this out as No plans as this is asking stuff around XNA

    background audio
    https://msdn.microsoft.com/en-us/library/windows/apps/mt282140.aspx

    A nice overview
    https://blogs.windows.com/buildingapps/2016/01/13/the-basics-of-background-audio/

    System media transport control overview
    https://msdn.microsoft.com/en-us/library/windows/apps/mt228338.aspx
    https://msdn.microsoft.com/en-us/library/windows/apps/windows.media.systemmediatransportcontrols.aspx

    3 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • ToddTodd commented  ·   ·  Flag as inappropriate

        There are some 3rd party Apps can do things like that. I begin to feel that there are already APIs that open to certain group of developers. If this is true, it is not fair.

      • Kurt CochranKurt Cochran commented  ·   ·  Flag as inappropriate

        I like the idea of simply adding APIs for creating/modifying/deleting music playlists. Think about how alarms work - WP8 keeps track of them and plays them when they're scheduled, but we can manage them programmatically, as it should be. Why lock down music playlists? That combined with the horribly implemented built-in support for user-created playlists makes me wish I skipped WP8 like I did WP7.

      Feedback and Knowledge Base