From 15e267a9ee0e8b4839cead401a2eff8d561bb6ab Mon Sep 17 00:00:00 2001 From: Vivien Didelot Date: Tue, 22 Oct 2013 16:28:04 -0400 Subject: [PATCH] plugins: add AlloCine support --- js/plugins.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/js/plugins.js b/js/plugins.js index fd69257..ed2ffe0 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -191,6 +191,25 @@ plugins.factory('userPlugins', function() { }); dailymotionPlugin.name = 'Dailymotion video'; + /* + * AlloCine Embedded Player + */ + var allocinePlugin = new Plugin(function(message) { + + var rVideokast = /allocine.fr\/videokast\/video-(\d+)/; + var rCmedia = /allocine.fr\/.*cmedia=(\d+)/; + + var match = message.match(rVideokast) || message.match(rCmedia); + if (match) { + var id = match[1]; + var embedurl = 'http://www.allocine.fr/_video/iblogvision.aspx?cmedia=' + id; + return ''; + } + + return null; + }); + allocinePlugin.name = 'AlloCine video'; + /* * Image Preview */ @@ -262,6 +281,6 @@ plugins.factory('userPlugins', function() { googlemapPlugin.name = 'Google Map'; return { - plugins: [youtubePlugin, dailymotionPlugin, imagePlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin] + plugins: [youtubePlugin, dailymotionPlugin, allocinePlugin, imagePlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin] } });