From ce7cbbab0e73cb539b07afc3b8acaef6221783f6 Mon Sep 17 00:00:00 2001 From: Tobias Ernst Date: Thu, 27 Apr 2017 14:46:22 +0200 Subject: [PATCH] added video suffix default value - for example facebook videos don't have a suffix ending but the type is mp4 --- src/js/lightcase.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/js/lightcase.js b/src/js/lightcase.js index a7ec2ee..299756a 100644 --- a/src/js/lightcase.js +++ b/src/js/lightcase.js @@ -798,10 +798,14 @@ * @param {string} url * @return {string} */ - _getFileUrlSuffix: function (url) { - var re = /(?:\.([^.]+))?$/; - return re.exec(url.toLowerCase())[1]; - }, + _getFileUrlSuffix: function (url) { + var re = /(?:\.([^.]+))?$/; + var suffix = re.exec(url.toLowerCase())[1]; + if(!suffix || _self.settings.typeMapping.video.indexOf(suffix) == -1) { + suffix = "mp4"; + } + return suffix; + }, /** * Verifies the data type of the content to load