How to set Video File Filters

Started by Ravindra, November 14, 2019, 03:29:39 PM

Previous topic - Next topic

Ravindra

Hello,

I am opening a video file directly from given path and not from openfiledialog.
I want to set filter to open various types of video files like
"Some video formats (*.avi;*.mpg;*.mpeg;*.wmv;*.asx;*.asf;*.mp4;*.vob;*.flv)|" & "*.avi;*.mpg;*.mpeg;*.wmv;*.asx;*.asf;*.mp4;*.vob;*.flv|" & "All files (*.*)|*.*"

Where do i write this ?

Thanks and Regards,

Ravindra


Administrator

Hello,

I'm afraid your question is not clear enough: could you be so kind to better explain with some more detail what you need to obtain?

Kind regards

Severino Delaurenti
MultiMedia Soft

Ravindra

Hi Severino,

Well i will elaborate.
I have developed a video player in which i open .mp4 files with internal path.
Usually we open using openfiledialog and where we define filter to open video files of format other than
.mp4 like MPEG, wav etc and accordingly we write it into its filter property.

However when i do not use openfiledialog my querry is,
Should i define this filter and where to define it or i am still able to open any video file in any format
without defining a filter directly ?

Thanks and Regards,

Ravindra

Administrator

Hello,

well, if you are not using the openfiledialog it's likely that you are invoking the VideoPlayer.Load method using a full pathname directly so you don't need a filter for the simple fact that the DirectShow filter graph builder will always attempt to manage the file independently from the file extension: if the file format shouldn't be supported the method will return an error code.

Hope to have answered your question.

Kind Regards

Severino Delaurenti
MultiMedia Soft