I have to build a media player in C# for my final project and I'm not sure where to begin.
I want it to be able to play most of the video and audio formats and have basic features like
a track bar, a play list, and the option to change the window size (full screen, different scales, etc.),
and maybe something that might be more ambitious like subtitles or format conversion.
Also I'd very much like to make my own interface (or is it skin?) for the player rather than use the
Visual Studio generic controls (otherwise I'd probably get a terrible score).

So far I've encountered a few video/audio player samples, some of them using DirectShow, MCI or WMP controls.
Now the question is which of those would fit my needs best?
Because I've read on DirectShow and from what I gathered it's not supported by .NET and it requires
the knowledge to work with COM objects which were basically replaced by .NET.

With the above in mind my questions are, what should I use? DirectShow, MCI, WMP controls?
A combinatino of them or something entirely different?
And does anyone know any samples or examples on how to build my own interface (skin?) for the player?
Maybe some tutorials, books or websites on the subject?
Any leads or tips would be greatly appreciated.

Thanks in advance,
teatime

Recommended Answers

All 3 Replies

I have to build a media player in C# for my final project and I'm not sure where to begin.
I want it to be able to play most of the video and audio formats and have basic features like
a track bar, a play list, and the option to change the window size (full screen, different scales, etc.),
and maybe something that might be more ambitious like subtitles or format conversion.
Also I'd very much like to make my own interface (or is it skin?) for the player rather than use the
Visual Studio generic controls (otherwise I'd probably get a terrible score).

So far I've encountered a few video/audio player samples, some of them using DirectShow, MCI or WMP controls.
Now the question is which of those would fit my needs best?
Because I've read on DirectShow and from what I gathered it's not supported by .NET and it requires
the knowledge to work with COM objects which were basically replaced by .NET.

With the above in mind my questions are, what should I use? DirectShow, MCI, WMP controls?
A combinatino of them or something entirely different?
And does anyone know any samples or examples on how to build my own interface (skin?) for the player?
Maybe some tutorials, books or websites on the subject?
Any leads or tips would be greatly appreciated.

Thanks in advance,
teatime

I would recommend you use the DirectX API which is provided by Microsoft. It is a very powerful API and can do everything from game development, playing video, playing audio, and mp3 files and a whole bunch of other features. It incorporates rather easily with C# .NET as well. It can be downloaded here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=b66e14b8-8505-4b17-bf80-edb2df5abad4&displaylang=en

This is a great article to get your feet wet. its a great beginners guide on how to play a simple video.

http://www.c-sharpcorner.com/UploadFile/mgold/PlayingVideo11242005002218AM/PlayingVideo.aspx

I have never really used the DirectShow library (Maybe part of DirectX?) but there's no reason you couldn't use it but I suspect you'll rely heavily on the Direct X API to accomplish this.

I don't recommend using wmp.dll, but I do recommend using directshow. Windows is built around directX. included in directX 10 and higher is the directX managed libraries that supply you with video and sound objects that are very simple to use.

DirectShow automatically builds a filter graph for video so you don't have to do it manually. that's how windows media player does it. the only real alternative is to manually build the filter graph, but I don't know why one would bother.

as for the skin. the simplest way is just to create custom drawn controls for each part you need. But if you are looking for some good grades you could write a skin engine and create a DLL full of resource images and have a loop that goes through them and applies the matching resource named images to matching named controls allowing they to be easily changed by changing which dll is loaded, and have it loaded by reflection so it can be easily switched out. (a folder of images or zipfolder could work equally well).

best of luck.

Thanks a lot! Great answers! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.