2

我有一个使用 SoundCloud js sdk 流式传输音频的页面。初始化如下所示:

SC.initialize({
    client_id: myId,
    redirect_uri: "https://" + window.location.host + "/soundcloud-callback"
});

该页面使用SC.whenStreamingReady,SC.getSC.stream在某种程度上等同于以下内容:

// Wait for SoundManager
SC.whenStreamingReady(function() {
    soundManager.onready(function() {

        // Get track metadata and stream the track itself
        SC.get("https://api.soundcloud.com/tracks/" + audioId, function(data) {
            SC.stream(data.stream_url, {...});
        });
    });
});

问题是SC.stream请求 https 页面 ( "https://api.soundcloud.com/tracks/" + audioId + "/stream") 但 302 被重定向到 http 页面 ( http://ec-media.soundcloud.com/... )。音频仍然有效,但我的浏览器栏中没有得到令人满意的锁定(并且这个请求是唯一阻止它的东西)。

难道我做错了什么?

4

1 回答 1

1

现在已解决此问题。

尝试从 https 导航到随机曲目

 https://api.soundcloud.com/tracks/82686108/stream?client_id=YOUR_CLIENT_ID 
 // will redirect you to  
 https://ec-media.soundcloud.com/SQyhrPCMQJyQ.128.mp3?%some_uuid%&AWSAccessKeyId=%amazon_access_key%&Expires=%expires%&Signature=%siganture%

和http

 http://api.soundcloud.com/tracks/82686108/stream?client_id=YOUR_CLIENT_ID 
 // will redirect you to  
 http://ec-media.soundcloud.com/SQyhrPCMQJyQ.128.mp3?%some_uuid%&AWSAccessKeyId=%amazon_access_key%&Expires=%expires%&Signature=%siganture%
于 2013-04-03T09:44:15.680 回答