|
|
@@ -1,5 +1,9 @@
|
|
|
$(document).ready(function () {
|
|
|
- initList(".");
|
|
|
+ if(folderFromVideoPlay != ""){
|
|
|
+ initList(folderFromVideoPlay);
|
|
|
+ }else{
|
|
|
+ initList("videos");
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
function initList(dir) {
|
|
|
@@ -13,12 +17,12 @@ function initList(dir) {
|
|
|
}).done(function (result) {
|
|
|
|
|
|
$("#video-list").empty();
|
|
|
-
|
|
|
dir_names = result["dir_names"];
|
|
|
file_tables = result["file_tables"];
|
|
|
+ console.log("dir: " + dir_names + " ,file: " + file_tables);
|
|
|
if (result["parent"] != undefined)
|
|
|
parent = result["parent"];
|
|
|
-
|
|
|
+
|
|
|
//directory
|
|
|
for (i = 0; i < dir_names.length; i++) {
|
|
|
$("#video-list").append('<div class="col-md-3">' +
|
|
|
@@ -40,18 +44,31 @@ function initList(dir) {
|
|
|
if (file_tables[j]["file_path"].includes(".m3u8")) {
|
|
|
$("#video-list").append('<div class="col-md-3">' +
|
|
|
'<section class="panel">' +
|
|
|
- "<a href='#' onclick='getVideo(" + file_tables[j]["id"] + ")'>" +
|
|
|
+ "<a href='#' onclick='getVideo(" + file_tables[j]["id"] + ",\"" + file_tables[j]["file_path"].split("/")[file_tables[j]["file_path"].split("/").length-2] + "\")'>" +
|
|
|
'<img class="video-static" src="' + file_tables[j]["file_path"].replace("m3u8", "jpg") + '">' +
|
|
|
'<img class="video-active" src="' + file_tables[j]["file_path"].replace("m3u8", "gif") +
|
|
|
'">' +
|
|
|
'</a>' +
|
|
|
'<div class="panel-body" id="">' +
|
|
|
'<div class="video-text">' +
|
|
|
- "<p style='font-size: 20px;'><i class='fa fa-video-camera'></i><a class='video-font' href='#' onclick='getVideo(" + file_tables[j]["title"].split("-")[0] + ")'>" + file_tables[j]["title"] + "</a></p>" +
|
|
|
+ "<p style='font-size: 20px;'><i class='fa fa-video-camera'></i><a class='video-font' href='#' onclick='getVideo(" + file_tables[j]["id"] + ",\"" + file_tables[j]["file_path"].split("/")[file_tables[j]["file_path"].split("/").length-2] + "\")'>" + file_tables[j]["title"] + "</a></p>" +
|
|
|
'</div>' +
|
|
|
'</div>' +
|
|
|
'</section>' +
|
|
|
'</div>');
|
|
|
+ }else if(file_tables[j]["file_path"].includes(".pdf")){
|
|
|
+ $("#video-list").append('<div class="col-md-3">' +
|
|
|
+ '<section class="panel">' +
|
|
|
+ "<a target='_blank' href='" + file_tables[j]["file_path"] + "'>" +
|
|
|
+ '<img class="video-active" src="/BIM-Monitor/assets/images/PDF-icon.png">' +
|
|
|
+ '</a>' +
|
|
|
+ '<div class="panel-body" id="">' +
|
|
|
+ '<div class="video-text">' +
|
|
|
+ "<p style='font-size: 20px;'><i class='fa fa-file-pdf-o'></i><a class='video-font' target='_blank' href='" + file_tables[j]["file_path"] + "'>" + file_tables[j]["title"] + "</a></p>" +
|
|
|
+ '</div>' +
|
|
|
+ '</div>' +
|
|
|
+ '</section>' +
|
|
|
+ '</div>');
|
|
|
}
|
|
|
}
|
|
|
}).error(function (error) {
|
|
|
@@ -59,8 +76,9 @@ function initList(dir) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-function getVideo(id) {
|
|
|
+function getVideo(id, folder) {
|
|
|
$.redirect('./video-play.php', {
|
|
|
- 'id': id
|
|
|
+ 'id': id,
|
|
|
+ 'folder': folder
|
|
|
});
|
|
|
}
|