我成功地使用的SoundCloud的插件API,除了setVolume()則會方法被打破:(SoundCloud Widget API setVolume方法破壞?
首先,我愛小部件,但我吹走,經過所有的驚人的工作沒有音量控制可用!當他們聽到100%的音頻,我不能用setVolume()改變它時,人們會立即「退出」我的網站。我必須讓它工作或拉動它:(
這是什麼正在發生,我有一個名爲「Widget」的實例(它在頁面上加載並播放)
widget.bind(SC.Widget.Events.READY, function() {
$('#audioIndictments').removeClass('remove'); // This disables a CSS rule, making the soundCloud iframe visible
widget.setVolume(10); // This should set the volume to 10% but doesn't :(
widget.getVolume(function(vol){
console.log(vol); // This outputs 0.1 in the console :/
console.log(widget); // This outputs the object in the console and I don't see anything out of whack :|
});
widget.play(); // This successfully fires up the widget and the audio begins playing :)
widget.setVolume(10); // Just to see if it makes a difference, after the play() method, I ran setVolume again after the play() method and still no change :(
widget.getVolume(function(vol){
console.log(vol); // This still outputs 0.1 in the console :/
});
});
奇怪的結果。發現另一位博客提出了類似的問題,但沒有得到滿意的答覆。這裏的交易是什麼?我沒有看到什麼?
感謝您抽出寶貴的時間:)
有同樣的問題。最重要的是,它有時從0回到100,或0到1 :)約翰M解決方案有點奏效。 – dikirill