Wavesurfer.js: playPause button does not work

Created on 24 Apr 2016  路  2Comments  路  Source: katspaugh/wavesurfer.js

Hi everyone !

I have a problem trying to create an audio with wavesurfer.js

Everything is fine the music is load but the playPayse button doesn't work

here is my code

HTML

<div id="waveform"></div>
 <button class="btn btn-primary" data-action="play" onclick="wavesurfer.playPause()">Play / Pause</button>

JS

var wavesurfer = WaveSurfer.create({
      container: '#waveform',
      waveColor: '#fff',
      progressColor: 'FDD670',
    });


    wavesurfer.load('http://ia902606.us.archive.org/35/items/shortpoetry_047_librivox/song_cjrg_teasdale_64kb.mp3');

Here is what i get :
capture d ecran 2016-04-24 a 13 40 15

I try to do it on google chrome safari and firefox but this damn button doesn't want to work and i don't find explanation about the playPause function on the website.

Thank you for your help

Most helpful comment

I just find the solution the code was right but i had a shitty z-index for something transparent and the button was unclickable ! :p

thanks anyway !

All 2 comments

I just find the solution the code was right but i had a shitty z-index for something transparent and the button was unclickable ! :p

thanks anyway !

Hello all,

I have a problem trying to play audio with wavesurfer.js in safari browser.
when i click on play button it's show me error only safari.

TypeError: 'undefined' is not a function (evaluating 'this.ac.createGainNode()')
app.js:23
TypeError: 'undefined' is not an object (evaluating 'wavesurfer.on')
app.js:19
TypeError: 'undefined' is not an object (evaluating 'wavesurfer.playPause')

Please help me. How to solve this problem.
Thanks in advance.

Was this page helpful?
0 / 5 - 0 ratings