1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

[video] show thumbnail for video files in dir-view/favorites/view-shared-dir pages

This commit is contained in:
llj
2017-04-19 16:21:33 +08:00
parent 4d3b1964f3
commit 3443479e75
7 changed files with 58 additions and 32 deletions

View File

@@ -720,6 +720,22 @@ define([
}
},
// check if a file is a video
videoCheck: function (filename) {
// no file ext
if (filename.lastIndexOf('.') == -1) {
return false;
}
var file_ext = filename.substr(filename.lastIndexOf('.') + 1).toLowerCase();
var exts = ['mp4', 'ogv', 'webm', 'mov'];
if (exts.indexOf(file_ext) != -1) {
return true;
} else {
return false;
}
},
compareTwoWord: function(a_name, b_name) {
// compare a_name and b_name at lower case
// if a_name >= b_name, return 1