plugins: add AlloCine support

This commit is contained in:
Vivien Didelot 2013-10-22 16:28:04 -04:00
parent dbb2bcb8f9
commit 15e267a9ee

View file

@ -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 '<iframe frameborder="0" width="480" height="270" src="' + embedurl + '"></iframe>';
}
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]
}
});