webamp icon indicating copy to clipboard operation
webamp copied to clipboard

Add new APIs to Webamp NPM module

Open captbaritone opened this issue 1 year ago • 2 comments

TODO

  • [x] Validate APIs work in test environment
  • [ ] Add to documentation
  • [ ] Figure out how we can cut a release with these new APIs given current state of build

Test Plan

Added the following to the demo site:

const LLAMA_TRACK = {
  metaData: {
    artist: "DJ Mike Llama",
    title: "Llama Whippin' Intro",
  },
  url: llamaAudio,
  duration: 5.322286,
};

webamp.onCurrentTrackDidChange((track, index) => {
  const currentTracks = webamp.getPlaylistTracks();
  const willRunOut =
    index === currentTracks.length - 1 &&
    !webamp.isRepeatEnabled() &&
    !webamp.isShuffleEnabled();
  if (willRunOut) {
    webamp.appendTracks([LLAMA_TRACK]);
  }
});

https://github.com/user-attachments/assets/4b101cf4-5861-4377-8a09-fb84939dc7e3

captbaritone avatar Aug 25 '24 17:08 captbaritone