In my application, I use UI MediaElement. But when i click the Windows key, the music stops.
I tried using:
MediaControl.PlayPressed += MediaControl_PlayPressed;
MediaControl.PausePressed += MediaControl_PausePressed;
MediaControl.PlayPauseTogglePressed += MediaControl_PlayPauseTogglePressed;
MediaControl.StopPressed += MediaControl_StopPressed;
I set source MediaElement:
media.Source = new Uri("http://stream-hq.mp3.zdn.vn/fsgggsfdlwjglwjAAAAA/2a3f830202ea6d29bc7c5a5146401566/4ff5620a/2011/12/27/a/4/a4fcc199a184a93cfeb0fe35642c53bf.mp3", UriKind.RelativeOrAbsolute);
Please help me!
Adding background music to recorded audio Select a music category, then search or scroll to find and preview the background music you like for your segment. To add it to your recording, finish by clicking the 'checkmark' icon while hovering over the desired music track.
Right click a video file > Open with > Photos. On the toolbar, click Edit & Create > Create a video with text. You are now in Photo's Editor Screen. Click on Music and select an audio file from Music folder.
For a Metro/WinRT app to play audio in background, the app needs the following:
Package.appxmanifest
. Select it in the Solution Explorer, go to the Declarations tab and check "Audio" as shown:See the Transport Controls Guide for more info about capturing hardware buttons (e.g. play/pause on the keyboard) and the quickstart guide for creating a media player for more info.
This would be my first answer. Make sure you set AudioCategory="BackgroundCapableMedia"
in your XAML like this:
<MediaElement x:Name="backgroundMusic"
AutoPlay="True"
AudioCategory="BackgroundCapableMedia"
Source="mms://betafm.santafe-conicet.gov.ar:1175">
</MediaElement>
Hope it helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With