kyw
kyw

Reputation: 7545

GET chrome-extension://< soundcloud's stream url > net : : ERR_FAILED

So I'm trying to stream soundcloud with soundmanager2, but i got this error from my background event page:

GET chrome-extension://api.soundcloud.com/tracks/155143944/stream?    
client_id=d47c763873f2jan403dac26b62e3a820 net::ERR_FAILED chrome- 
extension://api.soundcloud.com/tracks/155143944/stream?
client_id=d47c763873f2jan403dac26b62e3a820:1

T/tracks/155143944-0.7370116342790425: HTML5 error, code 4 soundmanager2.js:1191
T/tracks/155143944-0.7370116342790425: Failed to load / invalid sound? Zero-length    
duration reported. (chrome-extension://api.soundcloud.com/tracks/155143944/stream?  
client_id=d47c763873f2jan403dac26b62e3a820) soundmanager2.js:1189

Here is my code:

Manifest:

 "permissions": [
    "tabs",
    "*://soundcloud.com/*"
  ],

"background": {
    "scripts": ["soundmanager2/script/soundmanager2.js", "soundcloud_SDK.js",     
                "background.js"],
    "persistent": false
 },

Background.js:

SC.initialize({
    client_id: "d47c763873f2jan403dac26b62e3a820"
});

soundManager.setup({
    url: 'soundmanager2/swf',
    onready: function() {
       SC.stream("/tracks/155143944", function(sound){
        sound.play();
      });
    }
});

Upvotes: 0

Views: 1262

Answers (1)

Rob W
Rob W

Reputation: 349142

This seems like an issue with protocol-relative URLs.

Look in the source files for strings like //api.soundcloud.com/ and put https: in front of it.
And maybe also location.protocol + '//api.soundcloud.com/' -> https://api.soundcloud.com/.

Upvotes: 3

Related Questions