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
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%) |
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 |
Shipped in a separate commit and released in v2.1.1
Did not ship onCurrentTrackDidChange since I think onTrackDidChange should suffice