How to detect whether playing media is audio or video.
Hello All!
I am not having a lot experience in coding JMF based apps. So i need your help to proceed.
My requirements are to detect that whether the clip i am going to play is audo file or video or both. Basically i want to create a control (JPanel) on which i can display an icon before playing the clip indicating that the clip is of what type. Hopefully i have conveyed my point.
Please guide me as i am in urgencey due to tight deadlines in a project.
Regards,
Alam Sher
[511 byte] By [
alam.shera] at [2007-11-26 16:00:13]

# 2
> ...> Please guide me as i am in urgencey due to > tight deadlines in a project.For tight deadlines and urgency, you are probablybetter off taking up a Sun support ticket, or hiringa consultant.
# 4
One possibility is once the Processor (or Player) is in the configured state you can retrieve the TrackControls and analyze (getFormat) the format that is set for each individual Track .If the Format is an instance of AudioFormat you can assume some form of audio, VideoFormat....
Note that these formats are what JMF is using for a default OUTPUT format based on the INPUT media. However, you can probably assume that the output and input will match up as far as Audio and Video..
I'm not sure but I also believe at this point JMF does not know if the input is missing a particular track. For example if the input format in general has an audio and video track, both will be present in the TrackControls. This does not necessarily mean that the data actually has data for both tracks.
I don't know of a method ...short of playing the media to determine that information positively.