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.

2.0 Minimap: canvas click does nothing; Initial load does not display waveform

See original GitHub issue

Having trouble with minimap plugin on version 2

Wavesurfer.js version(s):

2.0 beta 2

Browser version(s):

Chrome Version 62.0.3202.94 (Official Build) (64-bit)

Code needed to reproduce the issue:

  • Angular 1x.
  • wavesurfer.js and Minimap plugin built into vendor.js file via gulp
  • directive loads wavesurfer and minimap.
  • controller inits minimap later

(1) Canvas click issue:

Clicking on minimap canvas scrolled the audio on 1x, now nothing happens. Only main WS container canvas can be intereacted with. Hopefully I am missing some minimap config detail

(2) Minimap waveform does not display on first initialization?

Minimap will not show waveform on first load. ** Soution found: Found that the sequence of loading the minimap cleared the problem. Im not sure about the operations around promises but toggling the minimap before ‘ready’ seems to clear for me. code snippet:

vm.wavesurfer.load(activeUrl || null); vm.wavesurfer.once('ready', function () { // do stuff }); _toggleMinimap();

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
elliottb303commented, Sep 14, 2018

@thijstriemstra @roboswank Just updated and happy to see that minimap canvas works now! Thanks

0reactions
roboswankcommented, Jan 26, 2018

@thijstriemstra @PureSqncMedia

This could be semi related to https://github.com/katspaugh/wavesurfer.js/issues/1311

minimap.js line 113 (v2.0.3 of wavesurfer)

this.renderEvent =
            ws.params.backend === 'MediaElement' ? 'waveform-ready' : 'ready';

If I change that to this.renderEvent = 'ready';, minimap functions as it did before and can be passed in the plugins array just the same.

I only say it could be related to https://github.com/katspaugh/wavesurfer.js/issues/1311 because it appears in both cases something was expecting there to be peak data available but there is not. Right before waveform-ready is fired, this.backend.setPeaks(null) is called, and I do not see anything in there that would set the peaks before firing it.

I do not necessarily know what the desired behavior here is. Like what potential negatives would come from listening to the ready event instead.

Edit: I have a solution for the click issue. Will open PR and see what you think.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't Click on the Mini Map bug? - General Discussion
Anyone else having an issue when you try to click on the mini map after you fire and it doesn't work? It seems...
Read more >
[HTML][HTML5 Canvas].pdf
Our first example will use the DOM to locate the <canvas> tag on the HTML5 page so ... page needs to load before...
Read more >
https://www.ugamusic.ug/UgaMusic/node_modules/wave...
This was done by splitting the `destroy` method of the `WebAudio` backend, ... (#1312) - Minimap plugin: fix initial load, canvas click did...
Read more >
HTML5 Canvas, Second Edition
Text Arranger Version 2.0 ... not work the first time around. ... page needs to load before your JavaScript can work with the...
Read more >
Unreal Engine 5.1 Release Notes
Starting in Unreal 5.1, Nanite requires Shader Model 6 to be enabled with DirectX 12. ... Please note that this feature does not...
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