var spot = {
url: 'https://embed.spotify.com/?uri=' + uri,
width: 300,
- height: 80
+ height: 80
};
break;
case "artist":
return $(html);
},
+ soundcloud: function () {
+ var url = this.$el.data('url'),
+ $content = this.$content.find('.content');
+
+ $.getJSON('http://soundcloud.com/oembed', { url: url })
+ .then(function (data) {
+ $content.empty().append(
+ $(data.html).attr('height', data.height - 100)
+ );
+ }, function () {
+ $content.html(_kiwi.global.i18n.translate('client_views_mediamessage_notfound').fetch());
+ });
+
+ return _kiwi.global.i18n.translate('client_models_applet_loading').fetch();
+ },
custom: function() {
var type = this.constructor.types[this.$el.data('index')];
return $(type.buildHtml(this.$el.data('url')));
}
-
}
}, {
html += '<span class="media spotify" data-type="spotify" data-uri="' + uri + '" data-method="' + method + '" title="Spotify ' + method + '"><a class="open"><i class="fa fa-chevron-right"></i></a></span>';
}
+ matches = (/(?:m\.)?(soundcloud\.com(?:\/.+))/i).exec(url);
+ if (matches) {
+ html += '<span class="media soundcloud" data-type="soundcloud" data-url="http://' + matches[1] + '" title="SoundCloud player"><a class="open"><i class="fa fa-chevron-right"></i></a></span>';
+ }
+
return html;
}
});