question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What is the purpose of the following code?

See original GitHub issue

https://github.com/katspaugh/wavesurfer.js/blob/master/src/wavesurfer.js#L705-L708:

// avoid draw wrong position while playing backward seeking
if (!paused) {
    this.backend.pause();
}

This code here pauses the backend (and then later plays it) when the user does a seek/when the code runs seekTo.

It runs the audioprocess event before the seek event is run. My code depends on the seek event being first (indicating a user-controlled move).

I would like to just put the play command after the seek event is fired (to preserve the functionality of an audioprocess running on a seekTo) and remove the pause command.

Would this break anything? The avoid draw wrong position while playing backward seeking comment doesn’t make sense to me…

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
agamemnuscommented, Jul 20, 2017

Also, since we are here, why does the seek click event run on a 0 timeout?:

// Click-to-seek
my.drawer.on('click', function (e, progress) {
    setTimeout(function () { my.seekTo(progress); }, 0);
});
0reactions
agamemnuscommented, Sep 4, 2017

Second one: a fix for an iOS bug that might be fixed already? Might need testing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fft - What is the purpose of the following code?
I think fft_max is a kind of equalization table so that the visualization would be "flat" over all frequencies for a typical input....
Read more >
What is the purpose of the following code? : r/learnpython
a. Find all elements in L that are more than 1000 characters long. b. Check if L contains a string that is more...
Read more >
What is the purpose of the % in the following code? [duplicate]
% is the "modulo" operator , i.e.: it's the remainder of the integer division of its two operands. That's one way to guarantee...
Read more >
What is the purpose of the following code segment ... - Chegg
Question: What is the purpose of the following code segment, assuming myList is initialized with random integer numbers? int myList[100]; int val ...
Read more >
python final Flashcards - Quizlet
what is the purpose of the following algorithm, written in pseudocode? ... after this code segment, what is the value of 'result'?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found