q2a-embed icon indicating copy to clipboard operation
q2a-embed copied to clipboard

Suggestion to add soundcloud.com

Open q2apro opened this issue 10 years ago • 0 comments

Soundcloud.com is getting more popular, they provide a nice embed widget. I did the embed by js, but probably for some users it is more suitable to have the embed code generated server side. The js code:

// javascript: parse soundcloud link to embed widget
function parse_soundcloud_links() {
    $('a[href*="soundcloud.com"]').each(function(){
        var $link = $(this);
        $.getJSON('http://soundcloud.com/oembed?format=js&url=' + $link.attr('href') + '&iframe=true&callback=?', function(response){
        $link.replaceWith(response.html);
        });
    });
}

q2apro avatar Apr 01 '14 08:04 q2apro