问题标签 [react-native-track-player]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
javascript - 反应原生轨道播放器远程下一个功能
我在使用 react-native-track-player 将曲目更改为下一个时遇到问题。
我需要在后台播放音乐时更改曲目,并且我在带有控件的 iOS 锁定屏幕上。
根据 react-native-track-player 文档(http://react-native-track-player.js.org/documentation/)我做了一个实现。
我有一个 service.js 文件:
我在组件文件中进行了功能配置。
曲目播放器在应用程序中运行良好,我可以暂停、播放、skipToNext、skipToPrevious。
我的问题是:当我在后台播放的锁定屏幕上播放时,播放器也能正常工作,我播放、暂停,但是当我在这里执行 skipToNext 或 skipToPrevious 时,它进入暂停状态(我无法从锁定屏幕开始- 但如果我打开设备,我会看到轨道已更改)。
这是我在 xCode 中的日志:
所以问题是:会有什么问题?您是否有从锁定屏幕 iOS 更改后台轨道的正确实现?任何帮助,将不胜感激。
版本:“react”:“17.0.2”,“react-native”:“0.65.1”,“react-native-track-player”:“^2.1.1”,xCode:13.0 iOS(真实设备测试) : 15.0
react-native - React-Native: cant't build app with react-native-track-player
Problem:
I can build the React Native App npx react-native run-android
but when I install react-native-track-player yarn add react-native-track-player
it fails to build.
What I have tried:
npm i react-native-track-player
(it can't be installed I don't know why?(ERESOLVE unable to resolve dependency tree))
System: Ubuntu and i have not installed Watchman
Error:
$ npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 898 file(s) to forward-jetify. Using 4 workers... info JS server already running.
- daemon not running; starting now at tcp:5037
- daemon started successfully info Launching emulator... info Successfully launched emulator. info Installing the app... Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Task :app:checkDebugAarMetadata FAILED 8 actionable tasks: 4 executed, 4 up-to-date Warning: Mapping new ns schemas.android.com/repository/android/common/02 to old ns schemas.android.com/repository/android/common/01 Warning: Mapping new ns schemas.android.com/repository/android/generic/02 to old ns schemas.android.com/repository/android/generic/01 Warning: Mapping new ns schemas.android.com/sdk/android/repo/addon2/02 to old ns schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns schemas.android.com/sdk/android/repo/repository2/02 to old ns schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns schemas.android.com/sdk/android/repo/sys-img2/02 to old ns schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns schemas.android.com/repository/android/common/02 to old ns schemas.android.com/repository/android/common/01 Warning: Mapping new ns schemas.android.com/repository/android/generic/02 to old ns schemas.android.com/repository/android/generic/01 Warning: Mapping new ns schemas.android.com/sdk/android/repo/addon2/02 to old ns schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns schemas.android.com/sdk/android/repo/repository2/02 to old ns schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns schemas.android.com/sdk/android/repo/sys-img2/02 to old ns schemas.android.com/sdk/android/repo/sys-img2/01
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.google.android.exoplayer:exoplayer-core:2.11.4. Searched in the following locations: - repo.maven.apache.org/maven2/com/google/android/exoplayer/exoplayer-core/2.11.4/exoplayer-core-2.11.4.pom - file:/home/maxim/.m2/repository/com/google/android/exoplayer/exoplayer-core/2.11.4/exoplayer-core-2.11.4.pom - file:/home/maxim/Desktop/Development/MusicApp/node_modules/react-native/android/com/google/android/exoplayer/exoplayer-core/2.11.4/exoplayer-core-2.11.4.pom - file:/home/maxim/Desktop/Development/MusicApp/node_modules/jsc-android/dist/com/google/android/exoplayer/exoplayer-core/2.11.4/exoplayer-core-2.11.4.pom - dl.google.com/dl/android/maven2/com/google/android/exoplayer/exoplayer-core/2.11.4/exoplayer-core-2.11.4.pom - www.jitpack.io/com/google/android/exoplayer/exoplayer-core/2.11.4/exoplayer-core-2.11.4.pom Required by: project :app > project :react-native-track-player
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at help.gradle.org
BUILD FAILED in 18s
error Failed to install the app. Make sure you have the Android development environment set up: reactnative.dev/docs/environment-setup. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 Warning: Mapping new ns schemas.android.com/repository/android/common/02 to old ns schemas.android.com/repository/android/common/01 Warning: Mapping new ns schemas.android.com/repository/android/generic/02 to old ns schemas.android.com/repository/android/generic/01 Warning: Mapping new ns schemas.android.com/sdk/android/repo/addon2/02 to old ns schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns schemas.android.com/sdk/android/repo/sys-img2/02 to old ns schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns schemas.android.com/repository/android/common/02 to old ns schemas.android.com/repository/android/common/01 Warning: Mapping new ns schemas.android.com/repository/android/generic/02 to old ns schemas.android.com/repository/android/generic/01 Warning: Mapping new ns schemas.android.com/sdk/android/repo/addon2/02 to old ns schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns schemas.android.com/sdk/android/repo/repository2/02 to old ns schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns schemas.android.com/sdk/android/repo/sys-img2/02 to old ns schemas.android.com/sdk/android/repo/sys-img2/01
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:checkDebugAarMetadata'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.google.android.exoplayer:exoplayer-core:2.11.4. Searched in the following locations: - https://repo.maven.apache.org/maven2/com/google/android/exoplayer/exoplayer-core/2.11.4/exoplayer-core-2.11.4.pom - file:/home/maxim/.m2/repository/com/google/android/exoplayer/exoplayer-core/2.11.4/exoplayer-core-2.11.4.pom - file:/home/maxim/Desktop/Development/MusicApp/node_modules/react-native/android/com/google/android/exoplayer/exoplayer-core/2.11.4/exoplayer-core-2.11.4.pom - file:/home/maxim/Desktop/Development/MusicApp/node_modules/jsc-android/dist/com/google/android/exoplayer/exoplayer-core/2.11.4/exoplayer-core-2.11.4.pom - https://dl.google.com/dl/android/maven2/com/google/android/exoplayer/exoplayer-core/2.11.4/exoplayer-core-2.11.4.pom - https://www.jitpack.io/com/google/android/exoplayer/exoplayer-core/2.11.4/exoplayer-core-2.11.4.pom Required by: project :app > project :react-native-track-player
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 18s
#xA;info Run CLI with --verbose flag for more details.
react-native - Android 12 崩溃最新 react-native-track-player 版本
在 android 12 中更新应用程序并尝试在 android 12 设备中运行应用程序后,模拟器面临崩溃问题。
这是问题。 androidx.media.session.MediaButtonReceiver:定位 S+(版本 31 及更高版本)要求在存在意图过滤器时定义 android:exported 的显式值'
解决 使用android:exported="true"修复运行应用程序的问题,但一旦播放器在应用程序中启动,服务就无法启动。所以再次崩溃应用程序。
ios - 为 ios "Swift.String.lowercased() -> Swift.String" 构建发布版本时出现问题
我已经开始为 ios 构建发布版本,这是我收到的错误:
有谁知道可能导致此错误的原因。答案是缺少桥接文件,但我已经检查过了。
reactjs - 由于 track-player 和 react-native-video 中的 exo 播放器版本冲突,react-native-track-player 崩溃
所以我同时使用 react-native-video 和 react-native-track-player ,通常两者都工作正常,但要使用视频播放器的一些额外功能,如缓冲,我必须使用 Exo player ,但手动使用 exo player 正在制作react-native-track 播放器崩溃,我试图得到答案,发现它是由于两个库使用的 exo 播放器版本冲突而发生的。谁能帮忙
谢谢
react-native-track-player - TrackPlayer.add 方法在 React-native-track-player 中不起作用
在这里,我正在添加 trackplayer 配音,但我无法收听配音音乐,它无法正常工作
这是我的配音对象
让 mw 知道我在哪里做错了
ios - 在 react-native-track-player 后台模式下不适用于 IOS 版本 13 及更高版本
我正在使用 react-native-track-player 版本 2.0.3
问题:有时当我最小化应用程序时,歌曲在完成一首歌曲后在后台播放,下一首歌曲不会在物理设备上自动播放。Xcode后台模式设置
IDE:
语言:
npmPackages:
react-native - 'react-native-track-player' 库是否有控制'音频立体声'的选项
目前,我正在使用名为'React-Native-Track-Player' 的ReactNative 库开发音频播放器。
为此,我需要知道上述库是否支持播放器中的立体声音频。
在我的研究中,我发现名为“react-native-sound”的库支持通过以下功能控制“音频立体声”:
getPan()
:返回音频播放器的立体声平移位置(不是系统范围的平移),范围从 -1.0(全左)到 1.0(全右)。默认值为 0.0(中心)。setPan()
: value {number} 设置平移,范围从 -1.0(全左)到 1.0(全右)。getNumberOfChannels
:返回声道数(1 表示单声道,2 表示立体声),或在加载声音之前返回 -1。
我也在“react-native-track-player”中寻找任何相应的功能。(我不能使用“react-native-sound”,因为它不支持流媒体,这是我的应用程序的基本功能。)
我找不到任何支持的证据:React-Native-Track-Player 支持“立体声音频”。我正在寻找一个在“react-native-track-player”和“react-native-sound”库中都有经验的人的答案。
所以,我的问题只是''react-native-track-player'库是否可以选择支持'音频立体声'和/或自定义声道?
react-native - 如何自定义 React 原生轨道播放器通知栏
我正在使用 react-native-track-player 创建一个音乐应用程序。我可以自定义通知区域和锁屏播放器吗?
我需要做的是更改背景颜色并将自定义主题添加到通知区域和锁定屏幕播放选项。有人可以让我知道该怎么做吗?
以下是我用来启用轨道播放器选项的代码。我怎样才能修改它来完成上述任务?或者是否有任何其他方法来执行自定义。太感谢了。