Music album web page generator
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

71 linhas
2.4 KiB

  1. import DedePlayer from './player.js';
  2. window.addEventListener('DOMContentLoaded', (event) => {
  3. const player = new DedePlayer(document.getElementById('player'));
  4. })
  5. //var current = undefined
  6. //const progressMargin = 50;
  7. //var progress = undefined;
  8. //window.addEventListener('DOMContentLoaded', (event) => {
  9. // progress = document.getElementById('player-progress');
  10. // document.getElementById('player-progress').addEventListener('click', (e) => {
  11. // if(current){
  12. // let media = current.getElementsByTagName('audio')[0];
  13. // media.currentTime = e.layerX * media.duration / progress.offsetWidth;
  14. //
  15. // }
  16. // });
  17. //
  18. // let toggler = document.getElementById('player-toggler');
  19. // toggler.setAttribute('title','afficher/masquer la liste des morceaux');
  20. // toggler.addEventListener('click', (e) => {
  21. // document.getElementsByTagName('ul')[0].classList.toggle('invisible');
  22. // })
  23. //});
  24. //
  25. //
  26. //function togglePlay(src) {
  27. // let media = src.getElementsByTagName('audio')[0];
  28. // let icon = src.getElementsByTagName('img')[0];
  29. // if (current){//stops current media and reset its play icon
  30. // pause();
  31. // }
  32. // if(current != src){
  33. // //sets current media icon and plays media
  34. // icon.setAttribute('src','assets/pause.png');
  35. // media.play();
  36. // progress.max = Math.floor(media.duration);
  37. // current = src;
  38. // document.getElementById('time-info').style.visibility = 'visible';
  39. // }
  40. // else{
  41. // current = undefined;
  42. // }
  43. //}
  44. //
  45. //function pause(){
  46. // current.getElementsByTagName('audio')[0].pause();
  47. // current.getElementsByTagName('img')[0].setAttribute('src','assets/play.png');
  48. // document.getElementById('time-info').style.visibility = 'hidden';
  49. //}
  50. //
  51. //function updateProgress(media){
  52. // progress.value = Math.floor(media.currentTime);
  53. // document.getElementById('time-info').innerHTML =
  54. // prettyDuration(media.currentTime) + ' / ' + prettyDuration(media.duration);
  55. //}
  56. //
  57. //function prettyDuration(duration) {
  58. // let sec = Math.floor( duration );
  59. // let min = Math.floor( sec / 60 );
  60. // min = min >= 10 ? min : '0' + min;
  61. // sec = Math.floor( sec % 60 );
  62. // sec = sec >= 10 ? sec : '0' + sec;
  63. // return min + ':' + sec;
  64. //}
  65. //
  66. //function togglePlayer(playerId, dpiId){
  67. // document.getElementById(playerId).classList.toggle('hidden');
  68. // document.getElementById(dpiId).classList.toggle('clicked');
  69. //}