Search code examples
c#.netwpfxamlmediaelement

Visual Studio WPF MediaElement not Displaying the video


This is my first time asking a question here. So I was following a tutorial (https://youtu.be/-zM486rVopk) then at the MediaElement part I am having a difficulty understanding on what's the source of my problem.

        <MediaElement Grid.Column="4" Grid.Row="1" Grid.RowSpan="6"
                      Source="C:\Users\Name\Documents\Visual Studio Workspace\WPFDemo\Resources\Crying Meme.mp4" />

Screenshots: Solution Explorer Properties

So I tried dragging the video file towards the form but this error message popped up...

Error: Error Pop up message

I don't know what it means, I'm pretty new to these things and I hope you understand. Thanks in advance!


Solution

  • it looks like it's a path problem, try this:

    <MediaElement Grid.Column="4" Grid.Row="1" Grid.RowSpan="6" Source="/Resources/Crying Meme.mp4" />