webamp
webamp copied to clipboard
Add new APIs to Webamp NPM module
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