react-native-nitro-player 1.7.0-alpha.2 → 1.7.0-alpha.3

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.
@@ -158,9 +158,13 @@ internal fun TrackPlayerCore.rebuildQueueFromCurrentPosition() {
158
158
  // ExoPlayer has already prepared, so gapless transitions survive.
159
159
  val existingCount = exo.mediaItemCount - currentIndex - 1
160
160
  var commonPrefix = 0
161
- while (commonPrefix < existingCount && commonPrefix < newQueueTracks.size &&
162
- extractTrackId(exo.getMediaItemAt(currentIndex + 1 + commonPrefix).mediaId) == newQueueTracks[commonPrefix].id
163
- ) {
161
+ while (commonPrefix < existingCount && commonPrefix < newQueueTracks.size) {
162
+ val existing = exo.getMediaItemAt(currentIndex + 1 + commonPrefix)
163
+ val track = newQueueTracks[commonPrefix]
164
+ if (extractTrackId(existing.mediaId) != track.id) break
165
+ // URI must match too — items materialized before lazy URL resolution are unplayable
166
+ val desiredUrl = if (isCastingField) track.url else downloadManager.getEffectiveUrl(track)
167
+ if (existing.localConfiguration?.uri?.toString().orEmpty() != desiredUrl) break
164
168
  commonPrefix++
165
169
  }
166
170
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-nitro-player",
3
- "version": "1.7.0-alpha.2",
3
+ "version": "1.7.0-alpha.3",
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",