jessuni / shikwasa

An audio player born for podcast
https://shikwasa.js.org
MIT License
476 stars 30 forks source link

fix(demo): sample code error #69

Closed LGiki closed 1 year ago

LGiki commented 1 year ago

Fix an error in the example code.

And, the code of fiddle in README should be updated as well: https://github.com/jessuni/shikwasa/blob/e0207022fbcba364269a13ef910c3ada26f643e0/README.md?plain=1#L102

The code in fiddle:

const player = new Shikwasa({
  container: document.querySelector('.container'),
  themeColor: '#000000',
  audio: {
    title: 'Episode title',
    artist: 'Shikwasa',
    cover: 'https://shikwasa.js.org/assets/logo-contrast.svg',
    src: 'https://shikwasa.js.org/assets/Minyo_San_Kyoku.mp3',
  }
})

Should be changed to:

const player = new Shikwasa.Player({
  container: document.querySelector('.container'),
  themeColor: '#000000',
  audio: {
    title: 'Episode title',
    artist: 'Shikwasa',
    cover: 'https://shikwasa.js.org/assets/logo-contrast.svg',
    src: 'https://shikwasa.js.org/assets/Minyo_San_Kyoku.mp3',
  }
})
jessuni commented 1 year ago

Oh thanks! The library has supported the ES6 module import only recently and I must have missed this part in the documentation. I'll make a small change to include the import part in the example as well to make it clearer to the developers.