سؤال

I need to know if a input file is a Video, Audio or a Image file.

Some of the audio files contains an video stream and a audio stream, so, I can't check the streams to know if it's a video or a audio.

Is there any way to know that? Thanks.

هل كانت مفيدة؟

المحلول

I have used class File.extension to know the extension of the file like:

if (f.extension == "jpg" || f.extension == "jpeg") {
 //image
}

It works for me.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top