0

I am working on windows store app (using xaml/C#), my question is can I have two media-elements on a single page, one will always play some background music and second will play some other sound depending upon user actions?

I tried it but not working for me, only background music is getting played the other sound is not getting played.

devson
  • 990
  • 8
  • 22

1 Answers1

0

I can't see problem. you can use 2 media elements on the same page. mediaControl1 plays always and mediaControl2 starts to play when user clicks on button.

 <Button Width="150" Height="150" Style="{StaticResource ButtonAppStyle}" Click="MainPage_Loaded">

  <MediaElement  x:Name="mediaControl1" Height="400" Source="Assets/muzika.mp3" RealTimePlayback="True" IsLooping="True"  />
          <MediaElement  x:Name="mediaControl2" Source="Assets/firework1.wav" IsMuted="True"/>


void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            mediaControl2.IsMuted = false;
            mediaControl2.Play();
        }
burusera
  • 189
  • 4
  • 11