Soundcloud HTML5 Widget is not loaded, throws error -


I'm trying to use the SoundCloud HTML5 widget

I want to load the widget then, javascript, tell me what to play. But when I tried to do this by code

    

I'm seeing everyone in the console

after loading before loading - load load before loading
load
before after loading try to reach the frame with url from frame with unsafe javascript url. There is a protocol of 'https' in the frame of use, which is being accessed by a protocol of 'http' that must match the protocol.

and error

No sound-clip widget url was provided in the widget

Now what I do Am I wrong? Why is console.log running three times, why is nothing full and why am I seeing the error?

OK, I think I get it. Important Things:

  • Anything should already be loaded into the HTML5 widget, otherwise it never loads and you can not even reload it. It does not matter what it is, but it should be an existing track.

  • The example here is incorrect - you should place a track URL as a parameter for the widget. , Whole w.soundcloud.com ... object.

    Modified, working version

      & lt; Script src = "http://connect.soundcloud.com/sdk.js" & gt; & Lt; / Script & gt; & Lt; Iframe id = "sc-widget" width = "100%" height = "166" scrolling = "no" frameborder = "no" src = "http://w.soundcloud.com/player/?url=http% 3 A% 2F% 2Fapi.soundcloud.com% 2Ftracks% 2F1848538 & show_artwork = true "& gt; & Lt; / Iframe & gt; & Lt; Script src = "http://w.soundcloud.com/player/api.js" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script & gt; Var widgetIframe = document.getElementById ('sc-widget'), widget = SC.Widget (widgetIframe), newWidgetUrl = 'http://api.soundcloud.com/tracks/1848538'; Console.log ("before load"); Widget.load (newWidgetUrl); Console.log ("After Load"); & Lt; / Script & gt;   

    Errors are still visible, but they are not really relevant.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -