Closed hardlyfivefeet closed 3 years ago
Hi @hardlyfivefeet,
Late reply...I know. The current tick defaults to 0 before playing for the first time so that the file starts from the beginning.
-Garrett
The problem with using else if(!this.startTime) return 0;
is that it makes it impossible to skipToTick()
before playing for the first time. For starting from the beginning, it seems to make more sense to just rely on the fact that this.startTick
defaults to zero. Is there a situation where both this.startTime
and this.tick
are zero (so it enters the else if
clause) and this.startTick
doesn't default to zero?
I can't remember exactly why I have the logic that way. But using Player.skipToTick(5555).play()
before first play seems to work as expected for me. Am I missing something?
-Garrett
Oh, I'm sorry, skipToTick()
itself wasn't the issue. The issue was that after calling skipToTick()
before playing for the first time, getCurrentTick()
still returns 0, while it should actually return the new startTick
.
Hi, my partner and I are using this library to implement a web player, and we realized that
getCurrentTick()
defaults to 0 beforePlayer
is played for the first time. Is there a reason for this or can we just remove theelse if
clause in the method, as follows?