apache / apache/cordova-plugin-media
Android 14 Won't Play MP3 files
- Dominant language
- JavaScript
- Stars
- 391
- Forks
- 762
- PR merge metrics
- No merged PRs in 30d
Description
# Bug Report
## Problem
On Android 14 (Pixel 5) I can no longer play MP3 files from the bundle either directly or via https://localhost.
Using Cordova Android 12.0.1 and cordova-plugin-media 7.0.0
I'm using Vite, so all of the files end up in assets/sound-abc123.mp3
Not doing anything fancy, just:
let foo = new Media('assets/sound-abc123.mp3') or https://localhost/assets/sound-abc123.mp3
foo.play()
/storage/emulated/0/Android/data/com.bundle.id/files/assets/sound-abc123.mp3: open failed: ENOENT (No such file or directory)
It WILL play, however, from the internet, i.e., new Media('https://some.website.abc/foo.mp3')
Thanks for any help!
### What is expected to happen?
The sound should play.
### What does actually happen?
I get a code 1 (or file not found when I experiment with other ways to get the file)
## Information
This code worked on Android 12.
### Command or Code
let foo = new Media('assets/sound-abc123.mp3') or https://localhost/assets/sound-abc123.mp3
foo.play()
### Environment, Platform, Device
Android 14, Pixel 5
### Version information
## Checklist
- [X ] I searched for existing GitHub issues
- [X ] I updated all Cordova tooling to most recent version
- [X ] I included all the necessary information above
Contributor guide
Research direction
Start by reproducing the Media constructor and play() calls on Android 14 with the bundled assets/sound-abc123.mp3 path and the https://localhost URL. Compare those failures with the working remote MP3 case; the issue is done when bundled MP3 files play successfully on Android 14.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, javascript
- Domain
- audio-video-rtc, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100