Closed dpaulino closed 10 months ago
This scenario is surprisingly difficult. Here's the current status
Background media playback
capability that UWP provides only works when the sound is started in the foreground and then the app goes to the backgroundThe result is:
Documentation I found online saying that the capability only works when the sound is started in the foreground: https://social.msdn.microsoft.com/Forums/windows/en-US/f6ecb11e-dbfd-406c-9ffd-5e4c047d3720/background-mediaplayer-not-working-in-uwp-when-minimized?forum=wpdevelop
Proposed alternative solution:
I disagree that this should be closed. Users should be offered a CMD option or some command line
switches to ensure app loads in the foreground. And then after starting app, the app is minimized.
Or you can add a "launcher" type of exe that handles this scenario.
Either a separate exe to handle startup options or command line switches should work. And CMD script would definitely work.
another switch option would be to set the volume after playing.
https://learn.microsoft.com/en-us/uwp/api/windows.applicationmodel.startuptask?view=winrt-22621