From 8c2ddda51ae8b48f4b665e7ac8a941602804bd45 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Mon, 16 Jan 2017 11:11:56 -0500 Subject: [PATCH] try fixing video expand --- contrib/js/nntpchan/expand-video.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/js/nntpchan/expand-video.js b/contrib/js/nntpchan/expand-video.js index a5d44ff..b14ff8a 100644 --- a/contrib/js/nntpchan/expand-video.js +++ b/contrib/js/nntpchan/expand-video.js @@ -206,14 +206,16 @@ function setupVideo(thumb, url) { }*/ } + function setupVideosIn(element) { + var vidRegex = /(\.webm)|(\.mp4)|(\.mkv)|(\.avi)|(\.m4v)|(\.ogv)|(\.flv)/; var thumbs = element.querySelectorAll("a.file"); for (var i = 0; i < thumbs.length; i++) { - if (/(\.webm)|(\.mp4)$/.test(thumbs[i].pathname)) { + if (vidRegex.test(thumbs[i].pathname)) { setupVideo(thumbs[i], thumbs[i].href); } else { var url = thumbs[i].href; - if (/(\.webm)|(\.mp4)$/.test(url)) setupVideo(thumbs[i], url); + if (vidRegex.test(url)) setupVideo(thumbs[i], url); } } }