Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot play mp3 neither from the documents folder, nor as a base64 string #95

Open
d0minYk opened this issue Nov 19, 2023 · 0 comments
Open

Comments

@d0minYk
Copy link

d0minYk commented Nov 19, 2023

Describe the bug
Is there any way to play mp3s written by the FileSystem plugin / base64 in memory? According to an older report it was possible in the following way, however i presume there might have been changes since.

To Reproduce

  1. Write base64 mp3 data to documents folder
    await Filesystem.writeFile({ path: fileName, data: base64Data.split(",")[1], directory: Directory.Data })
  2. Get uri of mp3 in documents folder
    let uri = await Filesystem.getUri({ directory: Directory.Data, path: fileName });
  3. Preload mp3
    const preloadRes = await NativeAudio.preload({
    assetId: "test",
    assetPath: uri.uri,
    audioChannelNum: 1,
    isUrl: true
    });
  4. App crashes with
    file:///var/mobile/Containers/Data/Application/E407FE9D-3D44-446E-A002-F1A790E41221/Documents/test2.mp3
    ⚡️ To Native -> NativeAudio preload 59491661
    CapacitorCommunityNativeAudio/Plugin.swift:233: Fatal error: Unexpectedly found nil while unwrapping an Optional value
    2023-11-19 19:38:21.772021+0700 App[660:33869] CapacitorCommunityNativeAudio/Plugin.swift:233: Fatal error: Unexpectedly found nil while unwrapping an Optional value

Expected behavior
The app plays the mp3 file

Smartphone (please complete the following information):

  • Device: iPhone 11 Pro
  • OS: iOS 16.4.1
  • Capacitor Version: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant