shikwasa icon indicating copy to clipboard operation
shikwasa copied to clipboard

[feature request] Customizable player templates

Open cgpro opened this issue 2 years ago • 2 comments

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.

cgpro avatar May 04 '22 07:05 cgpro

This would be awesome 👍

travisvn avatar Mar 01 '23 20:03 travisvn

Implemented with https://github.com/jessuni/shikwasa/pull/84

rolandschuetz avatar Dec 01 '23 22:12 rolandschuetz