Frage

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.

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top