My problem is simple, i have video file stored as a resource inside my executable. And i need to play it... But it just
doesn't work. It says that it
cant find the file for some reason.
I need to fix this and play a embedded video.
What I have tried:
Tried using different formats.
.gifs work fine, and simple images like .jpg work fine too.
But .mp4, .mkv, .wmv don't work. Didn't try more formats yet. But it works if i use video file which is external, not embedded in executable,
I tried using Media Element and even embedding vlc, and its always the same. "Cant find the video..."
Here's some code:
(DIDN'T WORK)
<wpf:VlcPlayer x:Name="vlcPlayer"/>
vlcPlayer.LoadMedia(@"/Resource/videok.wmv");
vlcPlayer.Play();
------------------------------
(WORKED FINE) (but its not what i want)
<Image gif:ImageBehavior.AnimatedSource="/Resource/videobackground.gif"></Image>
------------------------------
(DIDN'T WORK TOO)
<MediaElement MediaEnded="Loginbackground_MediaEnded" Source="/Resource/videok.wmv" Name="Loginbackground" ></MediaElement>
Tried using different file paths like
pack://application:,,,/myproject;component/Resource/videob.mp4
and
myproject;component/Resource/ideob.mp4
Tried changing build mode on my videos to
Resource,
Content,
Embedded Resource and
None. Still nothing.