renderer.js 970 B

123456789101112131415161718192021222324252627282930313233
  1. // This file is required by the index.html file and will
  2. // be executed in the renderer process for that window.
  3. // No Node.js APIs are available in this process because
  4. // `nodeIntegration` is turned off. Use `preload.js` to
  5. // selectively enable features needed in the rendering
  6. // process.
  7. // Init player
  8. // init playlist
  9. // init DomRenderer
  10. // domUtils
  11. import { Utils } from './assets/js/domUtils.js'
  12. import { MainPlayer } from './assets/js/player.js'
  13. import { initDom } from './assets/dom/renderers/FullDomeRenderer.js'
  14. let player = new MainPlayer()
  15. player.playlist.initPlaylist()
  16. player.initPlayer()
  17. initDom()
  18. let utils = new Utils()
  19. utils.initEvents()
  20. window.utils = utils
  21. window.player = player
  22. window.control = player.ctrlPlayer
  23. document.addEventListener('DOMContentLoaded', ()=> {
  24. let lastPlaylist = localStorage.getItem('playlist').split("|")
  25. if (lastPlaylist.length > 0) player.playlist.createPlaylist(lastPlaylist)
  26. }, false);