Coder Social home page Coder Social logo

Comments (8)

tkrkt avatar tkrkt commented on July 24, 2024

適当書いたけど、こんな感じでいいはず。

#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

from 245cloud.

pandeiro245 avatar pandeiro245 commented on July 24, 2024

@tkrkt さんこちら、色んな方から要望頂いていたのでめちゃくちゃ嬉しいです!
取り急ぎ下記で対応してみたのですが
#57

こなります。。。
image

ちなみにこの状態で元の生JSをコンソールで実行してみると
image

こんな感じでみぎがわ右側にいい感じにでました!

以上が取り急ぎの共有になります!

from 245cloud.

pandeiro245 avatar pandeiro245 commented on July 24, 2024

あ、#API読込み前提の部分見落としてました。。。
今からやります!

from 245cloud.

pandeiro245 avatar pandeiro245 commented on July 24, 2024

@tkrkt さんAPI埋め込みって
<script src="https://w.soundcloud.com/player/api.js"></script>
を読み込むだけではダメってことですよね。

tkrkt さんRailsはお使いですか?
もーしよろしければ
Rails化は無事masterブランチに取り込みましたので
そこに対してPullRequest頂けると幸いでございます...!

from 245cloud.

tkrkt avatar tkrkt commented on July 24, 2024

API埋め込みはその一行でいいはずです。(実際はサーバにおいて使ったほうがよさそうですが)
スクリプト適当に書きすぎて間違ってたっぽいですね。

from 245cloud.

tkrkt avatar tkrkt commented on July 24, 2024

出来てるっぽいのでCloseですね。ちょいアイコンがずれてますが。うーん。

from 245cloud.

tkrkt avatar tkrkt commented on July 24, 2024

勝手にCloseしない方が良かったかも。

from 245cloud.

pandeiro245 avatar pandeiro245 commented on July 24, 2024

@tkrkt closeしてもらって大丈夫ですよ!
別チケット化する運用でいければと思いますー!

from 245cloud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.