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

Size Change: +315 B (+0.06%)

Total Size: 494 kB

Filename Size Change
./packages/webamp/built/webamp.bundle.min.js 304 kB +170 B (+0.06%)
./packages/webamp/built/webamp.lazy-bundle.min.js 191 kB +145 B (+0.08%)

compressed-size-action

github-actions[bot] avatar Aug 25 '24 17:08 github-actions[bot]

Deploy Preview for vigorous-lalande-5190c2 failed.

Name Link
Latest commit bc33e18ca03ee272fda21a4e7a374d1bb56b9af5
Latest deploy log https://app.netlify.com/sites/vigorous-lalande-5190c2/deploys/66cb7b6a86c5570008e6ea00

netlify[bot] avatar Aug 25 '24 17:08 netlify[bot]

Shipped in a separate commit and released in v2.1.1

captbaritone avatar Jun 19 '25 21:06 captbaritone

Did not ship onCurrentTrackDidChange since I think onTrackDidChange should suffice

captbaritone avatar Jun 19 '25 21:06 captbaritone