voronianski / soundcloud-audio.js

:musical_note: SoundCloud tracks and playlists with HTML5 Audio API
http://caniuse.com/#feat=audio
284 stars 46 forks source link

Submit new npm release? #19

Closed gil-- closed 7 years ago

gil-- commented 7 years ago

Currently the latest npm release does not have the new setTime() function. Can you do a new npm release with setTime?

Local Error: Uncaught TypeError: _soundcloud.scPlayer.setTime is not a function

https://github.com/voronianski/soundcloud-audio.js/compare/1.1.0...master

gil-- commented 7 years ago

Also, as a follow up. I'm struggling to figure out how to use seek() & setTime().

Basically, how would I on page load, begin playing the song at a specific point, say 6 seconds into the song?

Currently I have (this works):
scPlayer.audio.currentTime = 6;
scPlayer.play();

But I'm trying to figure out what seek or setTime do as I thought seTime would work but it doesn't seem to.

I'm trying to do something like...
scPlayer.setTime(6);
scPlayer.play();

What am I missing? The function is simply abstracting .currentTime yet it falls into (!this.audio.readyState).

voronianski commented 7 years ago

@gil-- should be ok now, update to version 1.1.1.