Open cgpro opened 2 years ago
It would be a very handy feature to make the player templates customizable.
The player is based on templates already: https://github.com/jessuni/shikwasa/tree/main/src/templates But it's referenced internally at the moment.
I could imagine the following:
const TemplateChapter = `... my fancy markup ...` const TemplateIcon = `...` const TemplatePlayer = `...` // or with an import (a bit cleaner) import { TemplateChapter, TemplateIcon, TemplatePlayer } from './shikwasa-templates.js'; const player = new Shikwasa({ container: () => document.querySelector('.shikwasa-player'), tplChapter: TemplateChapter, tplIcon: TemplateIcon, tplPlayer: TemplatePlayer, audio: { title: '...', artist: '...', cover: '...', src: '...', }, });
Sometimes it is necessary to change the icons or change the structure of the layout fundamentally, which would be easy to do in this case.
This would be awesome 👍
Implemented with https://github.com/jessuni/shikwasa/pull/84
It would be a very handy feature to make the player templates customizable.
The player is based on templates already: https://github.com/jessuni/shikwasa/tree/main/src/templates But it's referenced internally at the moment.
I could imagine the following:
Sometimes it is necessary to change the icons or change the structure of the layout fundamentally, which would be easy to do in this case.