From 93ffdab7bd0b88442b1c71b9637efc40136afcc0 Mon Sep 17 00:00:00 2001 From: Liam Tarpey Date: Mon, 19 Sep 2016 11:23:56 +0100 Subject: [PATCH] build: add support for Facebook videos. As Facebook doesn't provide a video ID in it's embed code, we need to use the path that's supplied in the iframe embed link such as "https%3A%2F%2Fwww.facebook.com%2Ftheguardian%2Fvideos%2F563281880526246%2F&show_text=0&width=400" --- angular-fluidVid.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/angular-fluidVid.js b/angular-fluidVid.js index be0220c..2bb3c15 100644 --- a/angular-fluidVid.js +++ b/angular-fluidVid.js @@ -14,7 +14,7 @@ angular.module('tinacious.fluidVid', []) } if (!videoType) { - $log.error('Specify type, either \'youtube\' or \'vimeo\''); + $log.error('Specify type, either \'youtube\', \'vimeo\' or \'facebook\''); } // video code based on video type @@ -27,7 +27,11 @@ angular.module('tinacious.fluidVid', []) case 'vimeo': videoCode = ''; break; - + + case 'facebook': + videoCode = ''; + break; + default: $log.error('Sorry, the type "' + videoType + '" is not currently supported. Please use either \'youtube\' or \'vimeo\''); }