A videojs/video-js plugin to support soundcloud track links like:
npm install && grunt compile
will compile
One can then open the generated index.html
.
npm install
to prepare the environmentnpm test
to run the tests once (Karma with Jasmine)npm run karma
to run tests continuously once a file is changedgrunt
afternpm install
to prepare running the example at example/index.htmlgrunt watch
to continuously compile coffee and jade, and run livereload for the example you can run this alongsidenpm run karma
if you wish
We create an iframe (with a soundcloud-embed URL) in the player-element and,
using the soundcloud Widget API,
we initialize a widget that will give us the control methods, getters and setters we need.
Once the iframe is created it is hidden!
Since communication between the parent page and the widget's iframe is implemented through window.postMessage, it's not possible to return the value synchronously. Because of this, every getter method accepts a callback function as a parameter which, when called, will be given the return value of the getter method.
Due to this we have quite a few state variables when using the widget API.
Is generated with Codo and hosted on coffeedoc.info. Props to them :)