title: UWP MediaElement not play music
body: <p>I am implementing a music player that plays local music files.</p>
  
  <p>I got this error message as my MediaElement failed:</p>
  
  <blockquote>
    <p>MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED : HRESULT - 0x80070005</p>
  </blockquote>
  
  <p>How should I fix it? This is my MediaElement.</p>
  
  <pre><code>&lt;MediaElement
      x:Name="MediaPlayer"
      Grid.Column="1"
      AutoPlay="False"
      IsLooping="False"
      MediaEnded="MediaPlayer_MediaEnded"
      MediaFailed="MediaPlayer_MediaFailed"
      Volume="50" /&gt;
  </code></pre>
  
  <p>I have tried 3 ways of playing the audio but none of them worked for me.</p>
  
  <pre><code>var file = await StorageFile.GetFileFromPathAsync(music.Path);
  MediaPlayer.Source = new Uri(music.Path, UriKind.Absolute);
  //MediaPlayer.SetSource(await file.OpenReadAsync(), file.ContentType);
  //MediaPlayer.SetSource(await file.OpenAsync(FileAccessMode.Read), file.ContentType);
  </code></pre>
  
  <p>The music.Path (containing path and music filename) is correct because I can load the Album Cover thumbnail. By the way the music file is located at somewhere in the Desktop not in the Assets folder.</p>
  
  <p>I think there is a similar question here: <a href="https://stackoverflow.com/questions/17389227/mediaelement-in-windows-8-metro-app">Mediaelement in Windows 8 Metro App</a></p>
  
  <p>But I don't understand why one of the answer is opening a picker. I don't think that would be my solution as I am just playing all the music files under a local folder.</p>
  
  <p>---Update---</p>
  
  <p>I notice that the MediaElement plays music correctly when I am playing an Asset music. So I guess there should be a workaround for playing local music files?</p>