2017-12-23 9 views
0

私はsoundcloudウィジェットAPI(https://developers.soundcloud.com/docs/api/html5-widget)を使用しようとしていますsoundcloud web widget APIは古くなっていますか?

そして、私はセットに含まれるトラックに関するデータを取得したいと思います。

しかし、widget.getSounds()とwidget.getCurrentSoundを除く他のすべてのメソッドは機能しているようです。

ゲッターが非同期でコールバックを使用していることを理解しています。

プラス、私は他の方法を試してみたので、サウンドオブジェクトは単純な配列ではないことがわかったが、失敗しました。..

任意のヘルプや洞察してください

widget 
_ {} 

widget.getVolume(function(ret){console.log(ret)}); 
_ {} 
VM5139:1 50 

widget.getDuration(function(ret){console.log(ret)}); 
_ {} 
VM5164:1 255057 

widget.getPosition(function(ret){console.log(ret)}); 
_ {} 
VM5190:1 92164.92599999999 

widget.getCurrentSound(function(ret){console.log(ret)}); 
_ {} 
VM2993:3 Uncaught TypeError: currentSound.get is not a function 
    at _.<anonymous> (<anonymous>:3:47) 
    at m (sc.js:1) 
    at w (sc.js:1) 
(anonymous) @ VM2993:3 
m @ sc.js:1 
w @ sc.js:1 

widget.getCurrentSound(function(ret){console.log(ret.title)}); 
_ {} 
VM2993:3 Uncaught TypeError: currentSound.get is not a function 
    at _.<anonymous> (<anonymous>:3:47) 
    at m (sc.js:1) 
    at w (sc.js:1) 
(anonymous) @ VM2993:3 
m @ sc.js:1 
w @ sc.js:1 

widget.getCurrentSound(function(ret){console.log(JSON.stringify(ret))}); 
_ {} 
3VM2993:3 Uncaught TypeError: currentSound.get is not a function 
    at _.<anonymous> (<anonymous>:3:47) 
    at m (sc.js:1) 
    at w (sc.js:1) 
(anonymous) @ VM2993:3 
m @ sc.js:1 
w @ sc.js:1 

widget.getCurrentSound(function(ret){console.dir(ret)}); 
_ {} 
VM2993:3 Uncaught TypeError: currentSound.get is not a function 
    at _.<anonymous> (<anonymous>:3:47) 
    at m (sc.js:1) 
    at w (sc.js:1) 
+0

でのものと全く同じフォーマットされていますさらに詳細に?何かエラーがありますか?そしてもしそうなら、彼らは何ですか? –

+0

@BrettDeWoody getCurrentSound()とgetSounds()は、私が考えることのできる方法ではアクセスできません。戻り値は、返されたサウンドオブジェクトを記録しようとすると "currentSound.getは関数ではありません"のようなものです。返されたオブジェクトを使用する適切な方法はありますか? – Moon

答えて

0

私は方法がわかりませんこれは起こったが、コードは現在正常に動作している。

おそらく、サウンドクラウドサーバーまたはAPIが現時点では不安定だったのでしょうか?

widget.getSounds()とwidget.getCurrentSoundは()(JSで交換可能であるかのアレイ)JSON文字列

を返し、彼らはあなたが働いていないかを説明することはできhttps://w.soundcloud.com/player/api_playground.html

関連する問題