From 3ae6b122cbb6e3491677fd79e2d0c1b1a506db93 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 4 Apr 2016 19:43:34 -0400 Subject: Improve response for mp4 videos in parser --- themes/okadmin/public/js/parser.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'themes/okadmin/public/js/parser.js') 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, }) -- cgit v1.2.3-70-g09d2