summaryrefslogtreecommitdiff
path: root/themes/okadmin/public/js/parser.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-04-04 19:43:34 -0400
committerJules Laplace <jules@okfoc.us>2016-04-04 19:43:34 -0400
commit3ae6b122cbb6e3491677fd79e2d0c1b1a506db93 (patch)
treeea76c4f5d3ca69986129e8d3ede0e859404fdd13 /themes/okadmin/public/js/parser.js
parent1b2576bf18685a84053ba1ff7348076aa06ce851 (diff)
Improve response for mp4 videos in parser
Diffstat (limited to 'themes/okadmin/public/js/parser.js')
-rw-r--r--themes/okadmin/public/js/parser.js6
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,
})