react-native-nitro-player 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -152,9 +152,13 @@ internal fun TrackPlayerCore.rebuildQueueFromCurrentPosition() {
152
152
  // ExoPlayer has already prepared, so gapless transitions survive.
153
153
  val existingCount = exo.mediaItemCount - currentIndex - 1
154
154
  var commonPrefix = 0
155
- while (commonPrefix < existingCount && commonPrefix < newQueueTracks.size &&
156
- extractTrackId(exo.getMediaItemAt(currentIndex + 1 + commonPrefix).mediaId) == newQueueTracks[commonPrefix].id
157
- ) {
155
+ while (commonPrefix < existingCount && commonPrefix < newQueueTracks.size) {
156
+ val existing = exo.getMediaItemAt(currentIndex + 1 + commonPrefix)
157
+ val track = newQueueTracks[commonPrefix]
158
+ if (extractTrackId(existing.mediaId) != track.id) break
159
+ // URI must match too — items materialized before lazy URL resolution are unplayable
160
+ val desiredUrl = if (isCastingField) track.url else downloadManager.getEffectiveUrl(track)
161
+ if (existing.localConfiguration?.uri?.toString().orEmpty() != desiredUrl) break
158
162
  commonPrefix++
159
163
  }
160
164
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nitro-player",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "A powerful audio player library for React Native with playlist management, playback controls, and support for Android Auto and CarPlay",
5
5
  "main": "lib/index",
6
6
  "module": "lib/index",