Browse Source

comment part who crash chromium --"

master
Dryusdan 3 years ago
parent
commit
f20aa0671c
2 changed files with 19 additions and 4 deletions
  1. +17
    -3
      assets/js/app.js
  2. +2
    -1
      index.html

+ 17
- 3
assets/js/app.js View File

@ -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('<audio id="audioExpose" data-play="pause" controls preload="none"><source src="assets/audio/interview.mp3" type="audio/mpeg"></audio>');
$('[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('<div id="player"><div id="waveform"></div></div>');
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));
*/
});

+ 2
- 1
index.html View File

@ -60,9 +60,10 @@
</div>
<script src="assets/js/jquery-3.2.1.min.js"></script>
<script src="assets/js/jquery-ui-1.11.2.min.js"></script>
<!-- COMPATIBLE WITH FIREFOX ONLY
<script src="assets/js/wavesurfer.min.js"></script>
<script src="assets/js/wavesurfer.regions.js"></script>
-->
<script src="assets/js/app.js"></script>
<script src="assets/js/player.js"></script>
</body>
</html>

Loading…
Cancel
Save