We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, thanks a lot for building the API.
Is there any plans to have an ES6 wrapper of the API? So we could do something like:
import SC from 'soundcloud'; SC.init({ ... }); SC.get('/tracks', { genres: 'rock' });
The text was updated successfully, but these errors were encountered:
I don't know why this wouldn't work but it doesn't.
sdk.js:23 Uncaught TypeError: Cannot read property 'AudioContext' of undefined
import SC from 'soundcloud'; import EVENTS from '../Events'; let track = `/tracks/${window.location.search.substr(1)}`; const SOUNDCLOUD_STATES = { 'playing': EVENTS.PLAYING, 'paused': EVENTS.PAUSED, 'loading': EVENTS.LOADING, 'ended': EVENTS.COMPLETE, 'error': EVENTS.ERROR }; SC.stream(track).then(function(player){ player.play(); player.on('state-change', event => { window.postMessageNative(SOUNDCLOUD_STATES[event], '*'); }); document.addEventListener('message', window.listener = function(event) { let data = JSON.parse(event.data); switch (data.type) { case EVENTS.PLAY: player.play(); break; case EVENTS.PAUSE: player.pause(); break; case EVENTS.VOLUME: player.setVolume(.5); break; } }); });
Sorry, something went wrong.
No branches or pull requests
Hello, thanks a lot for building the API.
Is there any plans to have an ES6 wrapper of the API? So we could do something like:
The text was updated successfully, but these errors were encountered: