SoundCloud Widget API setVolume 方法坏了? [英] SoundCloud Widget API setVolume Method broken?

查看:36
本文介绍了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 :(

这是发生了什么,我有一个名为widget"的实例(它在页面上加载和播放良好).

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?

感谢您抽出宝贵时间:)

Thank you for taking the time :)

推荐答案

尝试使用介于 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天全站免登陆