diff --git a/package-lock.json b/package-lock.json index 9cc4c71..6c7c0cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -59,6 +59,7 @@ "react-native-sound": "0.13.0", "react-native-svg": "15.15.4", "react-native-tab-view": "4.3.0", + "react-native-track-player": "4.1.2", "react-native-video": "6.19.2", "react-native-view-shot": "5.1.0", "react-native-vision-camera": "4.7.3", @@ -8132,6 +8133,29 @@ "react-native-pager-view": ">= 6.0.0" } }, + "node_modules/react-native-track-player": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/react-native-track-player/-/react-native-track-player-4.1.2.tgz", + "integrity": "sha512-cIgMlqVJx/95hirUWPRW8CHxiBFj9Rjl/voKHh2jF/2URYMTQyt76t/m2FKvjeYUW2doKv4QSCBIOUmtyDLtJw==", + "license": "Apache-2.0", + "funding": { + "url": "https://github.com/doublesymmetry/react-native-track-player?sponsor=1" + }, + "peerDependencies": { + "react": ">=16.8.6", + "react-native": ">=0.60.0-rc.2", + "react-native-windows": ">=0.63.0", + "shaka-player": "^4.7.9" + }, + "peerDependenciesMeta": { + "react-native-windows": { + "optional": true + }, + "shaka-player": { + "optional": true + } + } + }, "node_modules/react-native-video": { "version": "6.19.2", "resolved": "https://registry.npmjs.org/react-native-video/-/react-native-video-6.19.2.tgz", diff --git a/package.json b/package.json index d689b75..ba38a43 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "react-native-bootsplash": "6.3.12", "react-native-svg": "15.15.4", "react-native-tab-view": "4.3.0", + "react-native-track-player": "4.1.2", "@react-native-vector-icons/common": "12.4.2", "@react-native-vector-icons/get-image": "12.3.0", "@react-native-vector-icons/material-icons": "12.4.1", diff --git a/patches/react-native-track-player+4.1.2.patch b/patches/react-native-track-player+4.1.2.patch new file mode 100644 index 0000000..04e58aa --- /dev/null +++ b/patches/react-native-track-player+4.1.2.patch @@ -0,0 +1,28 @@ +diff --git a/node_modules/react-native-track-player/android/src/main/java/com/doublesymmetry/trackplayer/module/MusicModule.kt b/node_modules/react-native-track-player/android/src/main/java/com/doublesymmetry/trackplayer/module/MusicModule.kt +index b2409a09939164c49c0f7a16bb6d3284e8eab8fb..699a6e4f4e2652eca69cd1d3a522c21971fee1b4 100644 +--- a/node_modules/react-native-track-player/android/src/main/java/com/doublesymmetry/trackplayer/module/MusicModule.kt ++++ b/node_modules/react-native-track-player/android/src/main/java/com/doublesymmetry/trackplayer/module/MusicModule.kt +@@ -545,7 +545,7 @@ class MusicModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaM + if (verifyServiceBoundOrReject(callback)) return@launch + + if (index >= 0 && index < musicService.tracks.size) { +- callback.resolve(Arguments.fromBundle(musicService.tracks[index].originalItem)) ++ callback.resolve(musicService.tracks[index].originalItem?.let { Arguments.fromBundle(it) }) + } else { + callback.resolve(null) + } +@@ -584,9 +584,11 @@ class MusicModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaM + if (verifyServiceBoundOrReject(callback)) return@launch + callback.resolve( + if (musicService.tracks.isEmpty()) null +- else Arguments.fromBundle( +- musicService.tracks[musicService.getCurrentTrackIndex()].originalItem +- ) ++ else musicService.tracks[musicService.getCurrentTrackIndex()].originalItem?.let { ++ Arguments.fromBundle( ++ it ++ ) ++ } + ) + } +