的SoundCloud的Widget API setVolume方法打破? [英] SoundCloud Widget API setVolume Method broken?

查看:133
本文介绍了的SoundCloud的Widget API setVolume方法打破?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功地使用的SoundCloud的部件API,除了setVolume()则会方法被打破:(

I'm successfully using Soundcloud's widget API, except the setVolume() method is broken :(

首先,我爱小部件,但我吹走,经过所有的惊人的工作没有音量控制可用!人们会立即返回键我的网站时,他们听到100%的音频和我不能使用setVolume()则会改变......我必须得到它的工作还是拉:(

First, I love the widget, but I'm blown away that after all that amazing work there is no volume control available! People will immediately "back button" out of my site when they hear 100% audio and I can't alter it using setVolume()... I have to get it working or pull it :(

下面是发生了什么,我有一个名为小部件(加载并在页面上打得很好)的一个实例。

Here is what is happening, I have an instance named "widget" (which loads and plays well on the page).

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 :/
    });
});

奇怪的结果。我发现了另一个博客谁问过类似的问题并没有得到满意的答复。这里有什么交易?什么是我没有看到?

Strange results. I found another blogger who asked a similar question and got no satisfactory answer. What's the deal here? What am I not seeing?

感谢您抽出时间:)

推荐答案

试着用0和1这固定它给我的一个音量。

Try using the a volume between 0 and 1. This fixed it for me.

0.25 = 25%,容积

0.25 = 25% volume

这篇关于的SoundCloud的Widget API setVolume方法打破?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆