doublesymmetry / react-native-track-player

A fully fledged audio module created for music apps. Provides audio playback, external media controls, background mode and more!
https://rntp.dev/
Apache License 2.0
3.3k stars 1.01k forks source link

TrackPlayer.remove API doc says it takes Track|Track[] but it appears to require [number] #2382

Open eedeebee opened 1 month ago

eedeebee commented 1 month ago

The docs say Track or Track[] but Typescript says it wants a number[].

The way our app works, I'd prefer either Track[] or an array of track IDs instead of indexes.

This is in 4.0 but could be in 4.1 as well.

lovegaoshi commented 1 month ago

number[] is correct. doc is probably high/unmaintained for a while. Any Track[] implementation requires u to do TP.getQueue and find indices manually. u might as well DIY.