From ef0e7500a017126bec893ab2824d09b3f8abca4f Mon Sep 17 00:00:00 2001 From: Xiao Date: Wed, 17 Apr 2024 09:36:10 -0700 Subject: [PATCH] docs(getting-started): update getting-started to use Event.PlaybackActiveTrackChanged (#2284) Event.PlaybackTrackChanged has been deprecated in favor of Event.PlaybackActiveTrackChanged --- docs/docs/basics/getting-started.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/docs/basics/getting-started.md b/docs/docs/basics/getting-started.md index fbcfc775e..03ed16fd3 100644 --- a/docs/docs/basics/getting-started.md +++ b/docs/docs/basics/getting-started.md @@ -142,10 +142,9 @@ const PlayerInfo = () => { // do initial setup, set initial trackTitle.. - useTrackPlayerEvents([Event.PlaybackTrackChanged], async event => { - if (event.type === Event.PlaybackTrackChanged && event.nextTrack != null) { - const track = await TrackPlayer.getTrack(event.nextTrack); - const {title} = track || {}; + useTrackPlayerEvents([Event.PlaybackActiveTrackChanged], async event => { + if (event.type === Event.PlaybackActiveTrackChanged && event.track != null) { + const {title} = event.track || {}; setTrackTitle(title); } });