use extension rather than whole name

This commit is contained in:
jmillman 2015-07-17 10:15:40 -04:00
parent 94c8e7b6fe
commit dabcf0cb0a

View File

@ -186,10 +186,10 @@ public class DataContentViewerMedia extends javax.swing.JPanel implements DataCo
* @return True if a video file that can be displayed
*/
private boolean isVideoSupported(AbstractFile file) {
String name = file.getName().toLowerCase();
String extension = file.getNameExtension();
//TODO: is this what we want, to require both extension and mimetype support?
if (AUDIO_EXTENSIONS.contains("." + name) || videoExtensions.contains("." + name)) {
if (AUDIO_EXTENSIONS.contains("." + extension) || videoExtensions.contains("." + extension)) {
try {
String mimeType = new FileTypeDetector().getFileType(file);
if (nonNull(mimeType)) {