title: WPF Media Element Video Source
body: <p>I try to set video source in XAML code, video doesn't play:</p>
  
  <pre><code>&lt;MediaElement x:Name="bgvideo" Width="800" Height="600"Source="/Videos/BG_LOOP_BIG.wmv" /&gt;
  </code></pre>
  
  <p>So I try to set video source in codebehind, that doesn't play too. :</p>
  
  <pre><code>bgvideo.Source = new Uri(@"pack://application:,,,/Videos/BG_LOOP_BIG.wmv", UriKind.Absolute);
  </code></pre>
  
  <p>or </p>
  
  <pre><code>bgvideo.Source = new Uri(@"/Videos/BG_LOOP_BIG.wmv");
  </code></pre>
  
  <p>It just play when video source is absoulte:</p>
  
  <pre><code>bgvideo.Source = new Uri(@"C:\SomeFolder\Videos\BG_LOOP_BIG.wmv");
  </code></pre>
  
  <p><strong>How can I set video source with relative source?</strong></p>