From 4eddc8bf57dda5288547dde441e893d4cb89f083 Mon Sep 17 00:00:00 2001 From: Vivien Didelot Date: Thu, 17 Oct 2013 20:14:39 -0400 Subject: [PATCH] plugins: add SoundCloud and MixCloud support --- js/plugins.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/js/plugins.js b/js/plugins.js index 73d9c13..880eaab 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -194,7 +194,32 @@ plugins.factory('userPlugins', function() { }); imagePlugin.name = 'image'; + /* + * Cloud Music Embedded Players + */ + var cloudmusicPlugin = new Plugin(function(message) { + + var match = message.match(urlRegexp); + + if (match) { + var url = match[0]; + + /* SoundCloud http://help.soundcloud.com/customer/portal/articles/247785-what-widgets-can-i-use-from-soundcloud- */ + if (url.indexOf("soundcloud.com") != -1) { + return ''; + } + + /* MixCloud */ + if (url.indexOf("mixcloud.com") != -1) { + return ''; + } + } + + return null; + }); + cloudmusicPlugin.name = 'cloud music'; + return { - plugins: [youtubePlugin, imagePlugin, spotifyPlugin] + plugins: [youtubePlugin, imagePlugin, spotifyPlugin, cloudmusicPlugin] } });