Home Manual Reference Source Test
import MinimapPlugin from 'wavesurfer.js/src/plugin/minimap.js'
public class | source

MinimapPlugin

Extends:

Observer → MinimapPlugin

Implements:

Renders a smaller version waveform as a minimap of the main waveform.

Example:

// es6
import MinimapPlugin from 'wavesurfer.minimap.js';

// commonjs
var MinimapPlugin = require('wavesurfer.minimap.js');

// if you are using <script> tags
var MinimapPlugin = window.WaveSurfer.minimap;

// ... initialising wavesurfer with the plugin
var wavesurfer = WaveSurfer.create({
  // wavesurfer options ...
  plugins: [
    MinimapPlugin.create({
      // plugin options ...
    })
  ]
});

Static Method Summary

Static Public Methods
public static

Minimap plugin definition factory

Constructor Summary

Public Constructor
public

constructor(params: *, ws: *)

Member Summary

Public Members
public
public

drawer: *

public
public
public
public

params: *

public

ratio: *

public

Minimap needs to register to ready and waveform-ready events to work with MediaElement, the time when ready is called is different (peaks can not be got)

public

util: *

public
public
public

Method Summary

Public Methods
public
public
public
public
public

init()

public

moveOverviewRegion(pixels: *)

public
public

render()

public

Inherited Summary

From class Observer
public

fireEvent(event: string, args: ...any)

Manually fire an event

public

Attach a handler function for an event.

public

once(event: string, handler: function): ListenerDescriptor

Attach a handler to an event.

public

un(event: string, fn: function)

Remove an event handler.

public

unAll()

Remove all event handlers.

Static Public Methods

public static create(params: MinimapPluginParams): PluginDefinition source

Minimap plugin definition factory

This function must be used to create a plugin definition which can be used by wavesurfer to correctly instantiate the plugin.

Params:

NameTypeAttributeDescription
params MinimapPluginParams

parameters use to initialise the plugin

Return:

PluginDefinition

an object representing the plugin

Public Constructors

public constructor(params: *, ws: *) source

Instantiate Observer

Override:

Observer#constructor

Params:

NameTypeAttributeDescription
params *
ws *

Public Members

public draggingOverview: boolean source

public drawer: * source

public overviewPosition: number source

public overviewRegion: * source

public overviewWidth: * source

public params: * source

public ratio: * source

public renderEvent: string source

Minimap needs to register to ready and waveform-ready events to work with MediaElement, the time when ready is called is different (peaks can not be got)

See:

public util: * source

Test:

public waveShowedWidth: * source

public waveWidth: * source

public wavesurfer: * source

Public Methods

public bindMinimapEvents() source

public bindWavesurferEvents() source

public createElements() source

public destroy() source

public init() source

public moveOverviewRegion(pixels: *) source

Params:

NameTypeAttributeDescription
pixels *

public regions() source

public render() source

public renderRegions() source