Soundcloud Redirects Https -> Http

梦想的初衷 提交于 2019-12-22 13:53:49

问题


I have a page using the SoundCloud js sdk to stream audio. The initialization looks like this:

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

The page uses SC.whenStreamingReady, SC.get and SC.stream in a way equivalent to the following:

// 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, {...});
        });
    });
});

The problem is that SC.stream requests an https page ("https://api.soundcloud.com/tracks/" + audioId + "/stream") but is 302 redirected to an http page (http://ec-media.soundcloud.com/...). Audio still works, but I don't get a satisfying lock in my browser bar (and this one request is the only thing stopping that).

Am I doing something wrong?


回答1:


This has been fixed now.

Try navigating to a random track from 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%

And with 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%


来源:https://stackoverflow.com/questions/15305674/soundcloud-redirects-https-http

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!