Skip to content

Commit

Permalink
Update wavesurfer.minimap.js (#955)
Browse files Browse the repository at this point in the history
* Update wavesurfer.minimap.js

renders the minimap without the need to resize the window.
Changed 

        this.wavesurfer.on('ready', this.render.bind(this));

to 

        this.wavesurfer.on('ready', my.render.bind(this));

* Update wavesurfer.minimap.js

added the fixes for the drawPeaks()

* update my.render to this.render

* add parameter check renderOnLoad

check to see if a parameter called "miniRenderOnLoad" is set to true, if it is render the minimap on load.

* Update wavesurfer.minimap.js

* add space after else

* render minimap on load

will update docs and create example for minimap plugin
- minimap should be initialized within the main wavesurfer ready event.
  • Loading branch information
entonbiba authored and katspaugh committed Feb 7, 2017
1 parent 8be87f7 commit e633171
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugin/wavesurfer.minimap.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ WaveSurfer.Minimap = WaveSurfer.util.extend({}, WaveSurfer.Drawer, WaveSurfer.Dr

bindWaveSurferEvents: function () {
var my = this;
this.wavesurfer.on('ready', this.render.bind(this));
// render on load
this.render();
this.wavesurfer.on('audioprocess', function (currentTime) {
my.progress(my.wavesurfer.backend.getPlayedPercents());
});
Expand Down

0 comments on commit e633171

Please sign in to comment.