title: MediaElement is playing audio only in debug mode, its not playing audio without debug mode
body: <p>I am working on windows phone 8 trying to implement the audio playing feature in my app by creating the user control and media element.</p>
  
  <p>Surprisingly audio is playing during debugging but as i run the app without debug mode audio does not play, i tried the await and async methodology but thats also not working.</p>
  
  <p><strong>MainPage.xaml.cs</strong></p>
  
  <pre><code>private async void AudioControl(string audioId, string audio_url)
  {
     customControlAudioPlayer.media_Id = audioId;
     customAudioPlayer.media_Url = audio_url;
     //Following function is dedicated to show control and play the audio.
     await customAudioPlayer.RenderView();
     gridContainsMediaElement.Visibility = Visibility.Visible;
  }
  </code></pre>
  
  <p><strong>MainPage.xaml</strong></p>
  
  <pre><code>xmlns:MyControls="clr-namespace:dbok.Controls"
  
  &lt;Grid Name="gridContainsMediaElement"  
        VerticalAlignment="Top"  
        Background="Black" Visibility="Collapsed"&gt;
          &lt;MyControls:AudioPlayerControl 
             x:Name="customControlAudioPlayer"/&gt;
         &lt;!--CloseClick="audioPlayerControl_CloseClick"--&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p><strong>CustomControlPlayer.xaml</strong></p>
  
  <pre><code> &lt;Grid Background="{StaticResource PhoneChromeBrush}"  &gt;
  
          &lt;MediaElement x:Name="audioMediaElement" AutoPlay="False" 
              Grid.Row="0" 
              MediaOpened="audioMediaElement_MediaOpened"
              MediaEnded="audioMediaElement_MediaEnded"
                      MediaFailed="audioMediaElement_MediaFailed"
              HorizontalAlignment="Center" Height="05" 
              VerticalAlignment="Center"/&gt;
  
      &lt;Slider Visibility="Visible" Margin="50,0,50,0"
              x:Name="mediaPositionSlider" Background="#f1592a" 
              Minimum="0" Grid.Row="0" 
              /&gt;
  
      &lt;/StackPanel&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p><strong>CustomControlPlayer.xaml.cs</strong></p>
  
  <pre><code> public string media_Id;
   public string media_Url;
  
   public async Task RenderView()
   {
      Uri file_url;
      if (Uri.TryCreate(media_Url, UriKind.Absolute, out file_url))
      {
          myElement.Source = file_url;
          myElement.Play();
  
          //I tried by check the media element state but its executing and playing only in debug mode. it was not working for me without debug i made it commented.
          //if (myElement.CurrentState != MediaElementState.Playing)
          //{
          //    myElement.Play();
          //}
          mediaPositionSlider.Value = 0;
          UpdateDuration(0);
     }
  
  //-----------
  
  private void UpdateDuration(double _myValue)
  {
      TimeSpan t = TimeSpan.FromSeconds(_myValue);
      string time_slot = string.Format("{0:D2}:{1:D2}:{2:D2}",
                     t.Hours,
                     t.Minutes,
                     t.Seconds);
      PlayStatusLabel.Text = time_slot.ToString();
  }
  </code></pre>
  
  <p>I have post my code, where &amp; what i am doing wrong by which its not playing in run mode inplace of debug mode ?</p>