title: MediaElement windows phone 8
body: <p>I am trying to play a video in my app. The video and the xaml file are present under the same folder.</p>
  
  <p>My xaml code (which is a user control)</p>
  
  <pre><code>&lt;Grid x:Name="LayoutRoot"&gt;        
      &lt;MediaElement x:Name="vid" MediaOpened="MediaElement_MediaOpened" 
                    Source="hey.mp4" AutoPlay="True" /&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>My xaml.cs file code</p>
  
  <pre><code>public Page1()
  {
      InitializeComponent();
  }
  
  private void MediaElement_MediaOpened(object sender, RoutedEventArgs e)
  {
      vid.Play();
  }
  </code></pre>
  
  <p>The video is not playing. I tried the source to be "/hey.mp4" also, but it didn't play.
  What is my mistake ?</p>