Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'nextTrack' does not exist on type '{ lastIndex?: number | undefined; lastTrack?: Track | undefined; lastPosition: number #2263

Open
Jackie-gurung opened this issue Mar 6, 2024 · 3 comments
Labels

Comments

@Jackie-gurung
Copy link

Jackie-gurung commented Mar 6, 2024

useTrackPlayerEvents([Event.PlaybackActiveTrackChanged], async (event) => {
switch (event.type) {
case Event.PlaybackActiveTrackChanged:
const playingTrack = await TrackPlayer.getTrack(event.nextTrack);
setTrack(playingTrack);
break;
}
});

Environment Info:
System:
OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Memory: 458.32 MB / 7.65 GB
Shell:
version: 5.0.17
path: /bin/bash
Binaries:
Node:
version: 19.6.0
path: ~/.nvm/versions/node/v19.6.0/bin/node
Yarn: Not Found
npm:
version: 9.7.2
path: ~/.nvm/versions/node/v19.6.0/bin/npm
Watchman: Not Found
SDKs:
Android SDK:
API Levels:
- "33"
- "34"
Build Tools:
- 33.0.1
- 34.0.0
- 35.0.0
System Images:
- android-33 | Google APIs Intel x86_64 Atom
Android NDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java:
version: 17.0.10
path: /usr/bin/javac
Ruby:
version: 2.7.0
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.5
wanted: 0.73.5
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: false

"react-native-track-player": "^4.0.1",
@lovegaoshi
Copy link
Contributor

if u come across the docs ud notice, nextTrack indeed doesnt exist on Event.PlaybackActiveTrackChanged.
https://rntp.dev/docs/api/events#playbackactivetrackchanged

@Jackie-gurung
Copy link
Author

Yes.
what can be done to get next track ?

@lovegaoshi
Copy link
Contributor

lovegaoshi commented Mar 6, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants