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

CursorPlugin

Extends:

Observer → CursorPlugin

Implements:

Displays a thin line at the position of the cursor on the waveform.

Example:

// es6
import CursorPlugin from 'wavesurfer.cursor.js';

// commonjs
var CursorPlugin = require('wavesurfer.cursor.js');

// if you are using <script> tags
var CursorPlugin = window.WaveSurfer.cursor;

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

Static Method Summary

Static Public Methods
public static

Cursor plugin definition factory

Constructor Summary

Public Constructor
public

constructor(params: *, ws: *)

Member Summary

Public Members
public

cursor: *

public

drawer: *

public

style: *

public
public

wrapper: *

Method Summary

Public Methods
public
public
public

init()

public
public

updateCursorPosition(progress: *)

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: CursorPluginParams): PluginDefinition source

Cursor 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 CursorPluginParams

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 cursor: * source

public drawer: * source

public style: * source

public wavesurfer: * source

public wrapper: * source

Public Methods

public destroy() source

public hideCursor() source

public init() source

public showCursor() source

public updateCursorPosition(progress: *) source

Params:

NameTypeAttributeDescription
progress *