467,150 Members | 1,122 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,150 developers. It's quick & easy.

How to play an embedded video file in C#

I am looking for a way to play embedded videos using either Windows Media Player, or DirectX. I have tried using the url option with WMP, but can only play files off the HDD. I am running into the same problem using DirectX, can only play videos from the HDD. I have added videos (*.wmv) to the project and set them to embedded resource. How can I then access and play them?
Jul 9 '08 #1
  • viewed: 3698
Share:
5 Replies
Could you elaborate on what you mean by embedded?
Jul 9 '08 #2
Forgive me if my terms are not correct. In the solution explorer, I right-click and select 'add', then 'existing item'. I then select the added video (*.wmv) and for it's build action property, I set it to 'embedded resource'. I have found many explanations on how to do this with pictures and text, even audio, but nothing for video.

I am trying to write a program that contains multiple videos. So that the user can not distribute them or access them without letting me know, I currently have them zipped up with a password. This is slow because I have to extract them to a temp file to play them in an embedded WMP on another form. I am trying to find a way to access them from within my program to eliminate the wait of extracting.
Jul 9 '08 #3
Forgive me if my terms are not correct. In the solution explorer, I right-click and select 'add', then 'existing item'. I then select the added video (*.wmv) and for it's build action property, I set it to 'embedded resource'. I have found many explanations on how to do this with pictures and text, even audio, but nothing for video.

I am trying to write a program that contains multiple videos. So that the user can not distribute them or access them without letting me know, I currently have them zipped up with a password. This is slow because I have to extract them to a temp file to play them in an embedded WMP on another form. I am trying to find a way to access them from within my program to eliminate the wait of extracting.
I'll research this problem some myself. What version of the .Net framework are you using?
Jul 10 '08 #4
Thank you cnixuser.

Using Visual Studio 2008 and am writing in .NET 2.0. If need be, I can switch to .NET 3.0 or 3.5.
Jul 10 '08 #5
Maybe this is an alternative to embedding the files... Is there a way to encrypt a file (video) and have the program be able to read it without having to decrypt the file to a temp location? I know that Windows can encrypt files, making it that only that user can access/run them. Is there a way that I can make it so that my program is the only program that can have access to the files?
Jul 11 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by tushargupta82@gmail.com | last post: by
5 posts views Thread by mcfarlandorama@gmail.com | last post: by
6 posts views Thread by xhunter | last post: by
3 posts views Thread by Ryan Liu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.