wavesurfer.js Playhead plugin

This demos the playhead plugin, which allows "return to last played" functionality, mimicking certain DAWs.

var wavesurfer = WaveSurfer.create({
        container: document.querySelector('#waveform'),
        waveColor: '#A8DBA8',
        progressColor: '#3B8686',
        backend: 'MediaElement',
        plugins: [
            WaveSurfer.playhead.create({
                returnOnPause: true,
                moveOnSeek: true,
                draw: true
            })
        ]
    });

    wavesurfer.on('ready', function(e) {
        wavesurfer.playhead.setPlayheadTime(2.3);
    });

Fork me on GitHub