I have this MediaElement
in my xaml page:
<MediaElement
x:Name="soundMenu"
Source="Sounds/menu.wav"
AutoPlay="False" MediaEnded="soundMenu_MediaEnded"/>
and I want it to play when page is loaded (like background music):
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
soundMenu.Play()
}
It doesn't work. When I click on some button and try to play music it's working but this isn't. What's wrong with this? How can I play sound after page is loaded?
P.s.: I know I must check if user is playing something. I just for now want to solve this issue:)