-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SoundCloudの音量調節 #54
Comments
適当書いたけど、こんな感じでいいはず。 #soundcloud.coffee
#API読込み前提
@play: (sc_id, client_id, $dom, is_autoplay=true) ->
container = $dom.html("""
<div>
<label>
Volume <input type="range" min=0 max=100 value=100>
</label>
<iframe width="100%" height="400" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?visual=true&url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F#{sc_id}&show_artwork=true&client_id=#{client_id}&auto_play=#{if is_autoplay then 'true' else 'false'}&t=3000"></iframe>
</div>
""")
widget = SC.Widget($('iframe', container)[0]);
$("input", container).on("change", ->
widget.setVolume($(this).val() / 100)
)
widget.getVolume((volume) ->
$("input", container).val(volume * 100)
)
container |
あ、 |
@tkrkt さんAPI埋め込みって tkrkt さんRailsはお使いですか? |
API埋め込みはその一行でいいはずです。(実際はサーバにおいて使ったほうがよさそうですが) |
出来てるっぽいのでCloseですね。ちょいアイコンがずれてますが。うーん。 |
勝手にCloseしない方が良かったかも。 |
@tkrkt closeしてもらって大丈夫ですよ! |
SoundCloudの音量調節をさっくり書いてみました。
245CloudでSoundCloud再生中に以下のスクリプトをコンソールにぶち込んだら、
プレーヤーの上にボリュームスライダーが挿入される、はず。
実際に入れるならもうちょいきれいに書けるかと。
ちなみにプルリクは良く知らないんで勉強中...
The text was updated successfully, but these errors were encountered: