restructuration player.js