added audioplayer contrib module

This commit is contained in:
Bachir Soussi Chiadmi
2017-11-25 16:05:32 +01:00
parent ff23c45e43
commit 0942e9a212
174 changed files with 21682 additions and 0 deletions
@@ -0,0 +1,25 @@
'use strict';
// Create an instance
var wavesurfer = {};
// Init & load audio file
document.addEventListener('DOMContentLoaded', function () {
wavesurfer = WaveSurfer.create({
container: document.querySelector('#waveform'),
plugins: [
WaveSurfer.cursor.create()
]
});
// Load audio from URL
wavesurfer.load('../media/demo.wav');
// Play button
var button = document.querySelector('[data-action="play"]');
button.addEventListener('click', wavesurfer.playPause.bind(wavesurfer));
});