2
我有一個使用SoundCloud js sdk來傳輸音頻的頁面。初始化看起來是這樣的:Soundcloud重定向Https - > Http
SC.initialize({
client_id: myId,
redirect_uri: "https://" + window.location.host + "/soundcloud-callback"
});
該頁面使用SC.whenStreamingReady
,在某種程度上SC.get
和SC.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/...)。音頻仍然有效,但我沒有在瀏覽器欄中獲得令人滿意的鎖定(並且這一請求是阻止該問題的唯一方法)。
我做錯了什麼?
我看着這幾個月回來,我的猜測是,這是不可能的,而無需使用一些中間代理服務器。在光明的一面,https://ec-media.soundcloud.com/很高興爲安全請求提供服務,以便您可以在自己的服務器上運行一些產生api.soundcloud.com請求並轉換爲HTTPS的內容。 – 2013-03-09 00:30:30
你可以試試'url.replace(/^http:/,'https:')'...? – nickf 2013-03-10 15:04:18
嘿喬爾,這將被儘快修復,所以你會得到適當的重定向到「https」。不便之處 – 2013-03-11 13:31:20