By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,665 Members | 1,251 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,665 IT Pros & Developers. It's quick & easy.

How to play an embedded video file in C#

P: 14
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
Share this Question
Share on Google+
5 Replies


P: 80
Could you elaborate on what you mean by embedded?
Jul 9 '08 #2

P: 14
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

P: 80
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

P: 14
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

P: 14
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.