diff --git a/assets/js/app.js b/assets/js/app.js index 251bee4..b574edb 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -195,6 +195,21 @@ $('#expose').on('click', function(){ $('#play').html('Écouter l\'interview'); $('#play').attr('data-action', 'play'); $('.expose').html('Télécharger l\'interview'); + + $('body').append(''); + $('[data-action="play"]').on('click', function(){ + var audioExpose = $("#audioExpose"); + if(audioExpose.data('play') === "pause"){ + audioExpose.trigger('play'); + audioExpose.attr('data-play', 'play'); + } + else{ + audioExpose.trigger('pause'); + audioExpose.attr('data-play', 'pause'); + } + }); + /* + * compatible only with firefox... $('body').append('
'); var wavesurfer = Object.create(WaveSurfer); @@ -203,9 +218,8 @@ $('#expose').on('click', function(){ container: document.querySelector('#waveform'), waveColor: '#3b75ad', progressColor: '#304559', - backend: 'MediaElement', + backend: 'WebAudio', height: 85, - pixelRatio: 1, barWidth: 1, }); // Load audio from URL @@ -214,5 +228,5 @@ $('#expose').on('click', function(){ document.querySelector( '[data-action="play"]' ).addEventListener('click', wavesurfer.playPause.bind(wavesurfer)); - + */ }); \ No newline at end of file diff --git a/index.html b/index.html index e19235e..8b6f97a 100644 --- a/index.html +++ b/index.html @@ -60,9 +60,10 @@ + -