@javascriptcommon/react-native-track-player 4.1.4 → 4.1.6

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.
@@ -10,7 +10,7 @@ buildscript {
10
10
  mavenCentral()
11
11
  }
12
12
  dependencies {
13
- classpath 'com.android.tools.build:gradle:8.8.2'
13
+ classpath 'com.android.tools.build:gradle:8.12.2'
14
14
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10"
15
15
  }
16
16
  }
@@ -55,6 +55,12 @@ android {
55
55
  jvmTarget = "1.8"
56
56
  }
57
57
  }
58
+
59
+ sourceSets {
60
+ main {
61
+ java.srcDirs += ["build/generated/source/codegen"]
62
+ }
63
+ }
58
64
  }
59
65
 
60
66
  repositories {
@@ -77,15 +83,15 @@ dependencies {
77
83
  implementation "com.facebook.react:react-native:+"
78
84
  }
79
85
  // Make sure we're using androidx
80
- implementation "androidx.core:core-ktx:1.16.0"
86
+ implementation "androidx.core:core-ktx:1.17.0"
81
87
  implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.1.0"
82
- implementation "androidx.lifecycle:lifecycle-process:2.9.2"
83
- implementation 'androidx.media:media:1.7.0'
88
+ implementation "androidx.lifecycle:lifecycle-process:2.9.3"
89
+ implementation 'androidx.media:media:1.7.1'
84
90
 
85
- implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.9.2")
91
+ implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.9.3")
86
92
  implementation("androidx.activity:activity-compose:1.10.1")
87
- implementation("androidx.compose.ui:ui:1.8.3")
88
- implementation("androidx.compose.ui:ui-graphics:1.8.3")
93
+ implementation("androidx.compose.ui:ui:1.9.0")
94
+ implementation("androidx.compose.ui:ui-graphics:1.9.0")
89
95
 
90
96
  implementation("androidx.media3:media3-exoplayer:1.8.0")
91
97
  implementation("androidx.media3:media3-session:1.8.0")
@@ -29,6 +29,7 @@ import timber.log.Timber
29
29
  import java.util.*
30
30
  import androidx.core.net.toUri
31
31
  import com.facebook.react.module.annotations.ReactModule
32
+ import com.lovegaoshi.kotlinaudio.models.AudioPlayerState
32
33
 
33
34
 
34
35
  /**
@@ -768,6 +769,10 @@ class MusicModule(reactContext: ReactApplicationContext) : NativeTrackPlayerSpec
768
769
  callback.resolve(musicService.lastConnectedPackage)
769
770
  }
770
771
 
772
+ fun isPlaying(): Boolean {
773
+ return musicService.state == AudioPlayerState.PLAYING
774
+ }
775
+
771
776
  // Bridgeless interop layer tries to pass the `Job` from `scope.launch` to the JS side
772
777
  // which causes an exception. We can work around this using a wrapper.
773
778
  private fun launchInScope(block: suspend () -> Unit) {
@@ -100,8 +100,7 @@ class QueuedAudioPlayer(
100
100
  add(item)
101
101
  } else {
102
102
  players().forEach { p ->
103
- p.addMediaItem(currentIndex + 1, parseAudioItem(item))
104
- p.removeMediaItem(currentIndex)
103
+ p.replaceMediaItem(currentIndex, parseAudioItem(item))
105
104
  p.seekTo(currentIndex, C.TIME_UNSET)
106
105
  }
107
106
  exoPlayer.prepare()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@javascriptcommon/react-native-track-player",
3
- "version": "4.1.4",
3
+ "version": "4.1.6",
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",
@@ -3,7 +3,7 @@ require "json"
3
3
  package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
4
 
5
5
  Pod::Spec.new do |s|
6
- s.name = package["name"]
6
+ s.name = "react-native-track-player"
7
7
  s.version = package["version"]
8
8
  s.summary = package["description"]
9
9
  s.license = package["license"]