473,699 Members | 2,417 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to play an embedded video file in C#

14 New Member
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
5 4249
cnixuser
80 New Member
Could you elaborate on what you mean by embedded?
Jul 9 '08 #2
TxAg03
14 New Member
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
cnixuser
80 New Member
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
TxAg03
14 New Member
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
TxAg03
14 New Member
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

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

Similar topics

3
9884
by: craig | last post by:
i want to make a button that will start an embedded windows media player playing AND in full screen. i can do it with TWO buttons: <input onclick="MediaPlayer.controls.play();" type="button" size="22" value="Play"> <INPUT type = "button"
0
1078
by: tushargupta82 | last post by:
Hi all, I have some video files embedded in html files included in a chm file. I am trying to invoke this chm file through a VB .NET application. The chm file opens when I click on a button in the VB application but the video doesn't play. Although the videos play perfectly if I execute the chm file directly. Please let me know if anybody knows what is the problem. Thanks
5
14468
by: mcfarlandorama | last post by:
Hello, How do I play a DVD from a website? I am starting with zero knowledge of media but have HTML Experience. I found out that Windows Media Player won't play the DVD. Do I suggest everyone download Real Player for free? or can I put a realplayer plug in on the server? Is it possible to check if they have DVD playing software and use that. The below mentioned is all I have and of course it is not working, that is why I am here.
16
14757
by: Dobedani | last post by:
Dear All, I found the code added below at: http://simplythebest.net/sounds/sound_guide.html Unfortunately, the code doesn't seem to work in Firefox. These are the error messages I can see in my Javascript Console: Error: self.document.guitar.IsReady is not a function Error: self.document.guitar.stop is not a function
13
4883
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives, suggestions or improvements? if( wmv file) document.write("<OBJECT id=Player classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 height="354" width="479">
6
5692
by: xhunter | last post by:
I have this problem on my website and no matter what I have not been able to get over it, it is really getting on my nervers. it's a problem that only exists in non IE browsers. the frame work of my website is php and lets say here is how the player is shown with very simple syntaxes: <OBJECT id="VIDEO" width="'.$x.'" height="'.($y+60).'" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"> <param...
3
8374
by: Ryan Liu | last post by:
Hi, I want to play Audio/Video in my C# application(standlalone, not web applicatoin). The source of multimedia may in different formats and decided by the end user, which I have no control. My question is -- which is the best approach to add multimedia capability to my c# application, to support most possible formats, and make it easiest for the end user(e.g. does not need convert before play it)?
3
8647
by: pavanip | last post by:
Hi, I am new to Silverlight application.I want to display video using Mediaelement tag and I used the below code to play video. <Canvas> <MediaElement x:Name="mPlayer" Width="640" Height="480" Source="a_video.avi"/> <Button x:Name="bPlay" Background="Green" Width="100" Height="45" Canvas.Left="8" Canvas.Top="497" Content="Play" /> <Button x:Name="bPause" Background="Yellow" Width="100" Height="45"...
0
8613
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8908
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7745
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.