From b5594d57547ede525c5e3997edf6fbf568c6aec1 Mon Sep 17 00:00:00 2001 From: hormigas Date: Fri, 13 Nov 2015 21:38:32 +0000 Subject: [PATCH] adding imgur gifv support to the videoPlugin --- js/plugins.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/plugins.js b/js/plugins.js index f659012..98e4010 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -302,10 +302,14 @@ plugins.factory('userPlugins', function() { * mp4 video Preview */ var videoPlugin = new UrlPlugin('video', function(url) { - if (url.match(/\.(mp4|webm|ogv)\b/i)) { + if (url.match(/\.(mp4|webm|ogv|gifv)\b/i)) { + if (url.match(/^http:\/\/(i\.)?imgur\.com\//i)) { + // remove protocol specification to load over https if used by g-b + url = url.replace(/\.(gifv)\b/i, ".webm"); + } return function() { var element = this.getElement(); - var velement = angular.element('') + var velement = angular.element('') .addClass('embed') .attr('width', '560') .append(angular.element('') @@ -314,6 +318,7 @@ plugins.factory('userPlugins', function() { }; } }); + /* * Cloud Music Embedded Players