2

Soundcloud HTML5 Widget API に苦労しています。メソッドとイベントは正常に動作していますが、ゲッターをログに記録できません。Soundcloud API ドキュメントを調べましたが、問題が見つかりません。Soundcloud Playground は正常に動作していますが、ブログhttp://developers.soundcloud.com/blog/html5-widget-apiで提供されている例は正しくありません。ここで何かが足りないのでしょうか、それとも API に問題があるのでしょうか? これは私の削除された HTML ですが、動作していません:

<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://w.soundcloud.com/player/api.js" type="text/javascript"></script>
<script>
        $(document).ready(function() {
            var widget = SC.Widget(document.getElementById('sc-widget'));
            widget.bind(SC.Widget.Events.READY, ready());

            function ready() {
                widget.getDuration(function(durationSC) {
                    console.log('Duration: ' + durationSC);
                });
            }

            $('button').click(function() {
                widget.toggle();
            });
        });
    </script>
</head>
<body>
    <iframe id="sc-widget" src="http://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/39804767&show_artwork=false&liking=false&sharing=false&auto_play=false" height="195" scrolling="no" width="480" frameborder="no"></iframe>
<button>Play / Pause</button>
</body>
</html>
4

1 に答える 1

1

ご報告いただきありがとうございます。実際、現在 API に問題があります。httpsウィジェットの iframe で使用することで簡単に修正できますsrc

できるだけ早く修正を展開し、https使用する必要があるドキュメントを修正するように努めます。

于 2013-01-22T23:17:55.640 に答える