AVI-Play
-
Is it possible to play an AVI-file (Xvid) from within my C# application? I word prefer to have a panel where the video i played, but mayby it is only possible to start an extern player like Zoom Player. Is so, how do you start an extern player from a C# program? - and yes I am a newbee ;-)
-
Is it possible to play an AVI-file (Xvid) from within my C# application? I word prefer to have a panel where the video i played, but mayby it is only possible to start an extern player like Zoom Player. Is so, how do you start an extern player from a C# program? - and yes I am a newbee ;-)
You can try the Windws Media Player ActiveX Control: 1. Right-Click the toolbox, choose "Customize Toolbox..." 2. On the COM tab select "Windows Media Player". 3. Drag a Media Player onto the form. 4. Set the file name in the properties box. 5. Run the application - you see your video running in the Media Player control. If you want to dive deeper into AVI handling, you can try playing the video yourself with managed DirectX or the
-
Is it possible to play an AVI-file (Xvid) from within my C# application? I word prefer to have a panel where the video i played, but mayby it is only possible to start an extern player like Zoom Player. Is so, how do you start an extern player from a C# program? - and yes I am a newbee ;-)
If you use the ActiveX Control like Corinna suggested maybe a look at the Media Player SDK on MSDN will be useful. Another player can be started by calling
Process.Start
method. See the documentation for theProcess
class for more information. If you want to control the started application you have to P/Invoke SendMessage to send message towards it. It think there was an article how to this with Media Player here on CodeProject.
-
Is it possible to play an AVI-file (Xvid) from within my C# application? I word prefer to have a panel where the video i played, but mayby it is only possible to start an extern player like Zoom Player. Is so, how do you start an extern player from a C# program? - and yes I am a newbee ;-)
An alternative method is to use the DirectShow runtime DLL: Quartz.dll. It's been a long time since I used it, but basically you add a reference to it in your project (it's in the System32 directory) and .NET will create the neccessary interop assemblies (I believe the reference will display as QuartzTypeLib in the Project Explorer). Following that you will have access to the necessary methods of DirectShow to playback audio and video files. Note that this method is a lot more complex than just using the Media Player control, but it will also be a lot more configurable for you. There is too much code to post as an example to make this work for you, but I'm sure there are a lot of samples online that you can use. HTH -Sheppe Pharis, MCSD