Skip to content

Can't play from content:// path #776

@arispati

Description

@arispati

Description

I use react-native-notification-sounds to get the sound list, it return the sound path: content://media/internal/audio/media/233. when i try to use that path, it shown an error message resource not found

Please post your code:

here is my code

import NotificationSounds from  'react-native-notification-sounds';
import Sound from 'react-native-sound';

NotificationSounds.getNotifications('alarm').then(alarmList  => {
  // content://media/internal/audio/media/233
  const sound = new Sound(alarmList[0].url, '', (error) => {
    if (error) {
      console.log('failed to load the sound', error);
      return;
    }
  });
});

Is your issue with...

  • iOS
  • Android
  • Windows

Are you using...

  • React Native CLI (e.g. react-native run-android)
  • Expo
  • Other: (please specify)

Which versions are you using?

  • React Native Sound: 0.11.1
  • React Native: 0.66.4
  • iOS:
  • Android: 10
  • Windows:

Does the problem occur on...

  • Simulator
  • Device

If your problem is happening on a device, which device?

  • Device:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions