diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-04-04 19:43:34 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-04-04 19:43:34 -0400 |
| commit | 3ae6b122cbb6e3491677fd79e2d0c1b1a506db93 (patch) | |
| tree | ea76c4f5d3ca69986129e8d3ede0e859404fdd13 /themes | |
| parent | 1b2576bf18685a84053ba1ff7348076aa06ce851 (diff) | |
Improve response for mp4 videos in parser
Diffstat (limited to 'themes')
| -rw-r--r-- | themes/okadmin/public/js/parser.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/themes/okadmin/public/js/parser.js b/themes/okadmin/public/js/parser.js index 95b391c..6c964f7 100644 --- a/themes/okadmin/public/js/parser.js +++ b/themes/okadmin/public/js/parser.js @@ -31,6 +31,8 @@ var Parser = { regex: /\.(mp4|webm)(\?.*)?$/i, fetch: function(url, done) { var video = document.createElement("video") + var url_parts = url.replace(/\?.*$/, "").split("/") + var filename = url_parts[ url_parts.length-1 ] video.addEventListener("loadedmetadata", function(){ var width = video.videoWidth, height = video.videoHeight video = null @@ -38,8 +40,8 @@ var Parser = { url: url, type: "video", token: "", - thumbnail: "", - title: "", + thumbnail: "http://okfocus.s3.amazonaws.com/misc/okcms/video.png", + title: filename, width: width, height: height, }) |
