Home Reference Source
import MediaSessionPlugin from 'wavesurfer.js/src/plugin/mediasession.js'
public class | source

MediaSessionPlugin

Extends:

Observer → MediaSessionPlugin

Implements:

Visualize MediaSession information for a wavesurfer instance.

Example:

// es6
import MediaSessionPlugin from 'wavesurfer.mediasession.js';

// commonjs
var MediaSessionPlugin = require('wavesurfer.mediasession.js');

// if you are using <script> tags
var MediaSessionPlugin = window.WaveSurfer.mediasession;

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

Static Method Summary

Static Public Methods
public static

MediaSession plugin definition factory

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public

params: *

public

Method Summary

Public Methods
public
public

init()

public

update()

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

MediaSession 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 MediaSessionPluginParams

parameters use to initialise the plugin

Return:

PluginDefinition

an object representing the plugin

Public Constructors

public constructor() source

Instantiate Observer

Override:

Observer#constructor

Public Members

public metadata: * source

public params: * source

public wavesurfer: * source

Public Methods

public destroy() source

public init() source

public update() source