Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9235339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:00:24+00:00 2026-06-18T07:00:24+00:00

I am using the following code to embed a soundcloud widget: SC.oEmbed(soundcloud_url, {color: 3C9FCE},

  • 0

I am using the following code to embed a soundcloud widget:

SC.oEmbed(soundcloud_url, {color: "3C9FCE"},  document.getElementById('container_id'));

How do I bind a SC.Widget.Events.Ready to it? I don’t see any way to set the id or class of the embed iframe so that I can select it. Nor do I know when it has been loaded so that I can bind it, such as the following dysfunctional code:

var frame = document.getElementById('container_id').getElementsByTag("iframe")[0];
frame.bind(SC.Widget.Events.Ready, listnerFucnt());

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:00:25+00:00Added an answer on June 18, 2026 at 7:00 am

    If the reason you are using SoundCloud JavaScript SDK is to be able
    to SC.oembed to get embed HTML when having only SoundCloud permalink,
    then you probably shouldn’t. You can interact with either /resolve
    or /oembed endpoints instead.

    The difference is that /oembed endpoint doesn’t require client_id
    to be specified in request, so let’s start with this approach first.

    Option 1

    I’ll use jQuery, but the idea should be clear:

    var SOUNDCLOUD_URL = 'http://soundcloud.com/georgconrad/shostakovich2',
        WIDGET_OPTIONS = '&color=3C9FCE&liking=false';
    
    jQuery
      .getJSON( 
        'http://soundcloud.com/oembed.json?url=' + SOUNDCLOUD_URL + WIDGET_OPTIONS 
      )
      .done( function ( data ) {
        var widget;
        $('body').html( data.html );
        widget = SC.Widget($('body').find('iframe')[0]);
        widget.bind('ready', function () {
          alert('widget ready');
        });
      });
    

    This code live and commented – http://jsbin.com/ilesum/2/edit

    Option 2

    The other thing you could do is to use /resolve endpoint, but you have to specify client_id in order to interact with it, plus you will need to construct Widget iframe HTML yourself (which isn’t too bad though):

    var SOUNDCLOUD_URL = 'http://soundcloud.com/georgconrad/shostakovich2',
        CLIENT_ID = 'YOUR_CLIENT_ID',
        TEMPLATE = '<iframe width="100%" height="166" scrolling="no" ' +
                   'frameborder="no" src="http://w.soundcloud.com/player/?url={url}{options}" '+ 
                   'class="sc-widget"></iframe>';
    
    $.getJSON(
      'http://api.soundcloud.com/resolve.json?url=' + SOUNDCLOUD_URL + 
      '&client_id=' + CLIENT_ID
    ).done(function ( soundData ) {
      // I am using String.prototype.supplant from Crockford
      // (if you follow example code link you'll see what I mean)
      $('body').html(TEMPLATE.supplant({
        url: soundData.uri,
        options: '&color=3C9FCE'
      }));
      widget = SC.Widget($('body').find('iframe')[0]);
      widget.bind('ready', function () {
        alert('widget ready');
      });
    });
    

    And example live as well http://jsbin.com/oqebuk/2/edit

    Please note you can disable HTML or Output panes on JSBin, so it’s easier to read the example JavaScript code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I using following code: var search = 'test'; if ($('#sku').find(search) ){ //alert(search); $(document).find(search).css('color','red'); <TABLE>
I am using the following code to embed Arial into my application: [Embed(source='../assets/fonts/Arial.ttf',fontFamily='CustomFont',fontWeight='regular', unicodeRange='U+0020-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E,U+0080-U+00FF,U+0100-U+017F,U+0400-U+04FF,U+0370-U+03FF,U+1E00-U+1EFF,U+2022,U+2219,U+20AC-U+21AC',
I am trying to show a google map using the following code: <embed height=400
I am embedding .mov file in the webpage using following HTML code <embed border=1
I am trying to embed a font using the following code that I found
I have a video embed using the following code: <video controls='false' preload='true' onplay='doPlayEvent()' onpause='doPauseEvent()'
I'm using the following code to embed a Google map into my page: http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Chicago+IL&z=15&iwloc=A&output=embed
So in my app, I embed a Youtube video using the following code: -
Using following code I try to get updated list of checkbuttons' corresponding text values,
I am creating date using following code try { newdatetime = new DateTime(2012, 2,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.