@javascriptcommon/react-native-track-player 4.1.25 → 4.1.26

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.
@@ -62,7 +62,7 @@ class Track
62
62
  headers!![header] = httpHeaders.getString(header)!!
63
63
  }
64
64
  }
65
- notPlayable = bundle.getBoolean("notPlayable", false) || uri == null || uri.toString().isBlank()
65
+ notPlayable = bundle.getBoolean("notPlayable", false)
66
66
  setMetadata(context, bundle, ratingType)
67
67
  queueId = System.currentTimeMillis()
68
68
  originalItem = bundle
@@ -8,8 +8,6 @@ import androidx.media3.common.MediaItem
8
8
  import androidx.media3.common.MediaMetadata
9
9
  import com.lovegaoshi.kotlinaudio.utils.getEmbeddedBitmapArray
10
10
  import com.lovegaoshi.kotlinaudio.utils.saveMediaCoverToPng
11
- import androidx.media3.datasource.RawResourceDataSource
12
- import com.doublesymmetry.trackplayer.R
13
11
  import java.util.UUID
14
12
 
15
13
 
@@ -85,7 +83,8 @@ fun audioItem2MediaItem(audioItem: AudioItem, context: Context? = null): MediaIt
85
83
 
86
84
  return MediaItem.Builder()
87
85
  .setMediaId(audioItem.mediaId ?: UUID.randomUUID().toString())
88
- .setUri(if (hasValidUrl && !isNotPlayable) audioItem.audioUrl else RawResourceDataSource.buildRawResourceUri(R.raw.silent_5_seconds).toString())
86
+ // Always set URI (even empty string) so ExoPlayer adds item to timeline
87
+ .setUri(audioItem.audioUrl)
89
88
  .setMediaMetadata(
90
89
  MediaMetadata.Builder()
91
90
  .setTitle(audioItem.title)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@javascriptcommon/react-native-track-player",
3
- "version": "4.1.25",
3
+ "version": "4.1.26",
4
4
  "description": "A fully fledged audio module created for music apps",
5
5
  "main": "lib/src/index.js",
6
6
  "types": "lib/src/index.d.ts",