Hi,
I need to create a class that is able to get the duration for MPEG2 and MPEG4 files. The best and easiest way I saw was to use WMPLIB. I am able to get the duration for the files but only when I start playing the file. So I chose to integrate that in a DLL. However, it seems that the control does not work normally unless from within Windows Forms. It doesn't initialize properly if I declare it by code rather than from the toolbox. Here is the code I tried:
Friend WithEvents wmp As AxWMPLib.AxWindowsMediaPlayer |
wmp.url="c:\file.mpg" '=>Error occurs here |
wmp.ctlcontrols.play() |
My question, how can I make use of WMPLIB from within a Class library without problems. Is there a better way to get the duration of MPEG files?
Thanks