如何在React Native Expo中播放背景音乐?

我真的不知道如何在反应本地博览会中播放背景音乐。 我尝试了很多添加音乐..因为我是初学者,所以我找不到 请帮助我

x4701481 回答:如何在React Native Expo中播放背景音乐?

您可以尝试从捆绑包中获取mp3的该库,也可以流式传输:https://github.com/react-native-kit/react-native-track-player#readme

,

Expo APIS尚不支持此功能

您可以检查此博览会功能请求的当前状态

https://expo.canny.io/feature-requests/p/audio-playback-in-background

,

它可以在Android上运行,但不能在带有expo的iOS上运行。需要在app.json中添加以下代码-

"ios": {
  "supportsTablet": true,"bundleIdentifier": "com.yourcompany.yourappname","buildNumber": "1.0.0","infoPlist": {
    "UIBackgroundModes": [
      "audio"
    ]
  }
},

在那之后,您必须创建iOS的独立应用程序,它才能在独立应用程序上运行。

本文链接:https://www.f2er.com/3144984.html

大家都在问